Sunday, February 13, 2005

installing athena

Installing Athena on this new machine was a long drawn out process. the bootkit didn't see the motherboard network card, so I borrowed a PCI network card from another machine.

backup /boot /dell /etc /lib/modules/2.4.21-15.EL /usr/X11R6/lib64 /var/lib

backup text of ls -laR, df, rpm -q -a, fdisk p q

I wish I had also backed up rpm --q -a --provides

on partitioning, careful not to blow away the Dell utility partition and the secret reinstall partition. And leave some space for a future operating system partition.

Remember to do advanced custom install to select a multiprocessor kernel.

editing grub and fstab to change hda into sda for this weird SATA is it SCSI or is it not madness.

redhat-config-network to configure the motherboard eth0.

SNOWFLAKE-A-THON

SNOWFLAKE-A-THON

My snowflake entry and source code.

import Complex
import System

type C = Complex(Double)

mandelbrot_eval::Int->C->Int
mandelbrot_eval max_iter c = 
  length 
  $ (takeWhile (\z -> (magnitude z) < 2))
  $ (take max_iter) 
  $ (iterate (\z ->  z*z+c) (0:+0) )

half_width_pixels::Int
half_width_pixels = 400
scaling::Double->Int->Double
scaling width = (* (width
            /(fromIntegral half_width_pixels)))
          . fromIntegral
range::Double->[Double]
range width= map (scaling width)
    [-half_width_pixels .. half_width_pixels]

iterations::Int
iterations = 200

main::IO ()
main = do{
   let {s = show (2*half_width_pixels+1)};
   putStrLn ("P3\n"++s++" "++s++"\n"++"255");
   args <- getArgs;
   let {side = exp(-(read (head args)))};
   putStr $ unlines $ map show
   $ concatMap (  (\i -> [i,i,(i+55)])
                . (mandelbrot_eval iterations)
                . (+ center) )
   $ [x:+y | x<-(range side), y<-(range side)]
}

center::C
center =  0.4245127190 :+ 0.2075302281

dkms nvidia driver rpm installing

So Dell shipped me this new dell machine running RHEL3 with a nvidia (pci express quadro nv 280 mumble something). Having reinstalled (with Athena) the task was to get the nvidia driver working again. Interesting things:

  • The rpm they gave me seemed to have been precompiled for 64bit linux.
  • It came with version 6624, thought the newest at support.dell.com was 6105
  • Whatever that 6105 package was from dell, I regret having tried it

Anyway, the right thing to do was to use /dell/source/dell-nvidia-6624.1dkms.src.rpm. First be root, then rpmbuild --rebuild it, then rpm -Uvh to install the rebuilt rpm. All the proper DKMS stuff gets triggered (because I had installed dkms first).

Twinview works happily as advertised, and I now have 3200x1200 display on two CRTs.

Tuesday, February 08, 2005

Fun with Internationalized Domain Names

Punycode converter See RFC3490, RFC3491, RFC3492 and RFC3454. For example, fdfd is gay.

Tuesday, January 25, 2005

Ultra-high Energy Cosmic Ray

You have: mega ton tnt
You want: eV
	* 2.6114477e+34

Could a single very high energy proton wipe out an entire city? The highest energy cosmic ray ever recorded (the Fly's Eye Event) was 3.2e20 eV, so we are still 14 orders of magnitude away.

You have: 3.2e20 eV
You want: mg tnt
        * 11.116406

Wednesday, January 19, 2005

Mandelbright

If each point outside the Mandelbrot set radiated proportional to escape time, would the total brightness be finite? -- Mobile Email from a Cingular Wireless Customer http://www.cingular.com

Sunday, January 16, 2005

md5sum and sha1sum of zeros

The file size is 10737418240.
% dd if=/dev/zero of=ztest bs=1k count=10M
10485760+0 records in
10485760+0 records out
% md5sum /tmp/ztest
2dd26c4d4799ebd29fa31e48d49e8e53  /tmp/ztest
% sha1sum /tmp/ztest
a0b6e2ca4e28360a929943e8eb966f703a69dc44  /tmp/ztest
Now, with 2,000,000,000 byte files (avoiding the maximum file size limitation):
% dd if=/dev/zero bs=1000 count=2000000 | md5sum
2000000+0 records in
2000000+0 records out
5ab9550b6548d740cc7713661f22e9af  -
% dd if=/dev/zero bs=1000 count=2000000 | sha1sum
2000000+0 records in
2000000+0 records out
752ef2367f479e79e4f0cded9c270c2890506ab0  -

Sunday, January 09, 2005

factorint precprime

The factorization of the integer preceding the first prime less than a given power of two.

? for(i=3,1000,print(i," ",factorint(precprime(2^i)-1)," ",gettime()))

exponentpreceding primefactorizationmilliseconds
3-1[2, 1; 3, 1]0
4-3[2, 2; 3, 1]0
5-1[2, 1; 3, 1; 5, 1]0
6-3[2, 2; 3, 1; 5, 1]0
7-1[2, 1; 3, 2; 7, 1]0
8-5[2, 1; 5, 3]0
9-3[2, 2; 127, 1]0
10-3[2, 2; 3, 1; 5, 1; 17, 1]0
11-9[2, 1; 1019, 1]0
12-3[2, 2; 3, 1; 11, 1; 31, 1]0
13-1[2, 1; 3, 2; 5, 1; 7, 1; 13, 1]0
14-3[2, 2; 3, 2; 5, 1; 7, 1; 13, 1]0
15-19[2, 2; 3, 1; 2729, 1]0
16-15[2, 4; 3, 2; 5, 1; 7, 1; 13, 1]0
17-1[2, 1; 3, 1; 5, 1; 17, 1; 257, 1]0
18-5[2, 1; 53, 1; 2473, 1]0
19-1[2, 1; 3, 3; 7, 1; 19, 1; 73, 1]0
20-3[2, 2; 3, 3; 7, 1; 19, 1; 73, 1]0
21-9[2, 1; 1048571, 1]0
22-3[2, 2; 3, 1; 5, 2; 11, 1; 31, 1; 41, 1]0
23-15[2, 4; 524287, 1]0
24-3[2, 2; 3, 1; 23, 1; 89, 1; 683, 1]0
25-39[2, 3; 29, 1; 61, 1; 2371, 1]0
26-5[2, 1; 479, 1; 70051, 1]0
27-39[2, 3; 11, 1; 101, 1; 15101, 1]0
28-57[2, 1; 3, 1; 7, 1; 11, 1; 581029, 1]0
29-3[2, 2; 7, 1; 73, 1; 262657, 1]0
30-35[2, 2; 7, 1; 2341, 1; 16381, 1]0
31-1[2, 1; 3, 2; 7, 1; 11, 1; 31, 1; 151, 1; 331, 1]0
32-5[2, 1; 5, 1; 19, 1; 22605091, 1]0
33-9[2, 1; 4294967291, 1]10
34-41[2, 1; 79, 1; 108733349, 1]0
35-31[2, 5; 3, 2; 7, 1; 11, 1; 31, 1; 151, 1; 331, 1]0
36-5[2, 1; 5, 1; 6871947673, 1]0
37-25[2, 1; 3, 1; 15473, 1; 1480417, 1]0
38-45[2, 1; 3, 1; 7, 2; 233, 1; 409, 1; 9811, 1]0
39-7[2, 3; 3, 3; 5, 1; 7, 1; 13, 1; 19, 1; 37, 1; 73, 1; 109, 1]0
40-87[2, 3; 3, 2; 1487, 1; 10269667, 1]0
41-21[2, 1; 5, 1; 43, 1; 5939, 1; 861089, 1]0
42-11[2, 2; 13, 1; 84577817521, 1]10
43-57[2, 1; 5, 2; 7, 1; 23, 1; 1092682363, 1]0
44-17[2, 1; 7, 1; 4583, 1; 7993, 1; 34303, 1]0
45-55[2, 3; 3, 1; 19, 1; 77158710721, 1]0
46-21[2, 1; 3, 1; 263, 1; 44593627489, 1]0
47-115[2, 2; 3, 1; 7, 1; 1675446289943, 1]10
48-59[2, 2; 797, 1; 2459, 1; 35905663, 1]0
49-81[2, 1; 5, 1; 223, 1; 252443925301, 1]10
50-27[2, 2; 3, 1; 6637, 1; 40123, 1; 352333, 1]0
51-129[2, 1; 701, 1; 1531, 1; 1049075089, 1]0
52-47[2, 4; 11, 1; 167, 1; 239, 1; 641110271, 1]10
53-111[2, 4; 5, 1; 61, 1; 23563, 1; 78332027, 1]0
54-33[2, 1; 3, 1; 5, 2; 486391, 1; 246912443, 1]0
55-55[2, 3; 3, 3; 709, 1; 235260911423, 1]10
56-5[2, 1; 5, 1; 1871, 1; 2207, 1; 2621, 1; 665789, 1]0
57-13[2, 1; 3, 1; 24019198012642643, 1]0
58-27[2, 2; 3, 1; 24019198012642643, 1]0
59-55[2, 3; 3, 1; 24019198012642643, 1]10
60-93[2, 1; 3, 1; 31, 1; 375983, 1; 16486124939, 1]10
61-1[2, 1; 3, 2; 5, 2; 7, 1; 11, 1; 13, 1; 31, 1; 41, 1; 61, 1; 151, 1; 331, 1; 1321, 1]0
62-57[2, 1; 3, 2; 1289, 1; 198762435067123, 1]0
63-25[2, 1; 3, 4; 17, 1; 23, 1; 319279, 1; 456065899, 1]10
64-59[2, 2; 11, 1; 137, 1; 547, 1; 5594472617641, 1]0
65-49[2, 1; 3, 3; 47, 1; 3384529, 1; 4294967291, 1]10
66-5[2, 1; 47, 1; 239831, 1; 3273004044197, 1]0
67-19[2, 2; 3, 2; 1409, 1; 2909351640045667, 1]10
68-23[2, 3; 47, 1; 239831, 1; 3273004044197, 1]0
69-19[2, 2; 3, 1; 41, 1; 239, 1; 5020034445340559, 1]10
70-35[2, 2; 13, 1; 463, 1; 5113, 1; 2854273, 1; 3360037, 1]0
71-231[2, 3; 709, 1; 185123, 1; 2248708131661, 1]10
72-93[2, 1; 3, 1; 251, 1; 3135701515849698017, 1]10
73-69[2, 1; 17, 1; 31, 1; 8960847216071433043, 1]0
74-35[2, 2; 61, 1; 523, 1; 242819, 1; 283007, 1; 2154013, 1]10
75-97[2, 1; 3, 2; 5, 1; 11, 1; 23, 1; 157, 1; 4229021, 1; 2498890063, 1]10
76-15[2, 4; 3, 3; 5, 1; 7, 1; 13, 1; 17, 1; 19, 1; 37, 1; 73, 1; 109, 1; 241, 1; 433, 1; 38737, 1]0
77-33[2, 1; 613, 1; 14629, 1; 70729, 1; 135559, 1; 878777, 1]10
78-11[2, 2; 13, 1; 21407, 1; 271506673682994863, 1]10
79-67[2, 2; 3, 1; 5, 1; 29, 1; 347392476900755509973, 1]0
80-65[2, 1; 5, 1; 19, 1; 283, 1; 2192857859, 1; 10252956977, 1]40
81-51[2, 2; 5, 2; 24178516392292583494123, 1]10
82-57[2, 1; 3, 1; 7, 1; 115135792344250397591063, 1]10
83-55[2, 3; 3, 1; 1873, 1; 6247, 1; 98299, 1; 540877, 1; 647771, 1]10
84-35[2, 2; 5, 1; 7, 1; 23, 1; 139, 1; 687839617, 1; 62829235873, 1]10
85-19[2, 2; 3, 2; 926902397, 1; 1159346153407711, 1]50
86-35[2, 2; 47, 1; 193, 1; 307, 1; 4463, 1; 108637, 1; 14325884401, 1]10
87-67[2, 2; 3, 1; 5, 1; 109, 1; 23473, 1; 328687, 1; 3066766765499, 1]10
88-299[2, 2; 11, 1; 23, 1; 2617, 1; 116857175046309048289, 1]10
89-1[2, 1; 3, 1; 5, 1; 17, 1; 23, 1; 89, 1; 353, 1; 397, 1; 683, 1; 2113, 1; 2931542417, 1]0
90-33[2, 1; 3, 1; 5, 1; 11, 1; 3751333452379940226967043, 1]10
91-45[2, 1; 11, 1; 479, 1; 5237, 1; 8753, 1; 173357, 1; 29565860677, 1]10
92-83[2, 2; 17, 1; 43, 1; 7649, 1; 30161, 1; 49639, 1; 147879785303, 1]0
93-25[2, 1; 3, 2; 550195573015724566621832987, 1]10
94-3[2, 2; 3, 1; 5, 1; 47, 1; 277, 1; 1013, 1; 1657, 1; 30269, 1; 178481, 1; 2796203, 1]10
95-15[2, 4; 127, 1; 911, 1; 8191, 1; 112901153, 1; 23140471537, 1]10
96-17[2, 1; 17, 1; 41, 1; 2503, 1; 11927401, 1; 1903750979809649, 1]30
97-141[2, 1; 5, 1; 7, 1; 30427, 1; 421493, 1; 176507042656349189, 1]50
98-51[2, 2; 3, 1; 11489, 1; 2298667203825814187296369, 1]10
99-115[2, 2; 3, 2; 11, 1; 23, 1; 103, 1; 216901, 1; 3114926258434939853, 1]10
100-15[2, 4; 3, 2; 5, 1; 7, 1; 13, 1; 17, 1; 97, 1; 193, 1; 241, 1; 257, 1; 673, 1; 65537, 1; 22253377, 1]10
101-69[2, 1; 2733092861843, 1; 463815415102075087, 1]150
102-33[2, 1; 3, 1; 5, 1; 3319, 1; 15761, 1; 3231076804495048272311, 1]10
103-97[2, 1; 3, 1; 5, 1; 19, 1; 17174671, 1; 131111671, 1; 7901051977843, 1]130
104-17[2, 1; 7, 1; 17, 1; 85220208418704497579610299521, 1]10
105-13[2, 1; 3, 1; 37, 2; 47, 1; 20773, 1; 26497, 1; 25507717, 1; 7483925773, 1]10
106-117[2, 1; 3, 1; 2593891, 1; 5212866077423626108151101, 1]30
107-1[2, 1; 3, 1; 107, 1; 6361, 1; 69431, 1; 20394401, 1; 28059810762433, 1]10
108-59[2, 2; 1233003839411, 1; 65798366413329190859, 1]160
109-31[2, 5; 3, 1; 5, 1; 17, 1; 53, 1; 157, 1; 1613, 1; 2731, 1; 8191, 1; 858001, 1; 308761441, 1]10
110-21[2, 1; 3, 2; 29, 1; 149, 1; 19801, 1; 842860357178749786904309, 1]10
111-37[2, 1; 3, 1; 5, 1; 8209, 1; 10541878544960465400841548563, 1]0
112-75[2, 2; 3, 1; 5, 1; 8209, 1; 10541878544960465400841548563, 1]10
113-133[2, 1; 3, 1; 249229, 1; 6944479252059789228019875067, 1]20
114-11[2, 2; 13, 1; 12853, 1; 31075037007432132746802580237, 1]0
115-67[2, 2; 3, 1; 5, 2; 353, 1; 96233, 1; 60884249347, 1; 66945988795223, 1]70
116-3[2, 2; 3, 2; 7, 1; 571, 1; 32377, 1; 174763, 1; 524287, 1; 1212847, 1; 160465489, 1]20
117-279[2, 3; 20769187434139310514121985316880349, 1]20
118-5[2, 1; 29, 1; 4729, 1; 264331, 1; 120282553, 1; 38105831644971763, 1]70
119-69[2, 1; 29, 1; 344064569, 1; 33304394189535351753233609, 1]220
120-119[2, 3; 7, 1; 17, 1; 107, 2; 443, 1; 588365753, 1; 467890108350253093, 1]90
121-73[2, 1; 3, 2; 71, 1; 1063, 1; 183033847, 1; 10691384514931340478341, 1]160
122-3[2, 2; 3, 2; 5, 2; 7, 1; 11, 1; 13, 1; 17, 1; 31, 1; 41, 1; 61, 1; 151, 1; 241, 1; 331, 1; 1321, 1; 61681, 1; 4562284561, 1]10
123-67[2, 2; 3, 1; 5, 1; 47, 1; 109, 1; 34595041857893574673792883343883, 1]10
124-59[2, 2; 11, 1; 2633, 1; 11285865197, 1; 16266011243783873888999, 1]290
125-9[2, 1; 11, 1; 19, 1; 101, 1; 75611, 1; 25593610799, 1; 520637276195190611, 1]110
126-137[2, 1; 317, 1; 3919, 1; 199974079, 1; 171214770098900531773639, 1]150
127-1[2, 1; 3, 3; 7, 2; 19, 1; 43, 1; 73, 1; 127, 1; 337, 1; 5419, 1; 92737, 1; 649657, 1; 77158673929, 1]10
128-159[2, 5; 3, 1; 10253, 1; 29333, 1; 4454477, 1; 42113237, 1; 62826870453001, 1]190
129-25[2, 1; 3, 2; 23, 1; 53, 1; 2207, 1; 73037, 1; 192419007647917553731343987, 1]10
130-5[2, 1; 23, 1; 32985101, 1; 897064739519922787230182993783, 1]60
131-69[2, 1; 19, 1; 20219, 1; 59351, 1; 59697771913750598441845212299, 1]10
132-347[2, 2; 4086621307, 1; 333069635141447143111442312491, 1]800
133-99[2, 2; 7, 1; 17, 1; 2447, 1; 23605948748323511, 1; 396029047604911001, 1]300
134-45[2, 1; 3, 1; 7, 1; 443, 1; 4241, 1; 275993039834493705010208653191503, 1]10
135-45[2, 1; 359, 1; 354034717, 1; 171348031280966828492853945787, 1]120
136-113[2, 1; 7, 1; 35023, 1; 177663425120146040044346163342727151, 1]20
137-13[2, 1; 3, 2; 15493, 1; 12611483, 1; 49537629558702115833889161799, 1]20
138-105[2, 1; 3, 1; 7, 1; 17, 1; 19, 1; 283, 1; 131267, 1; 355111, 1; 8336660597, 1; 233555095796839, 1]80
139-187[2, 2; 3, 1; 5, 2; 571, 1; 13218581, 1; 307770647134532760329414930789, 1]60
140-27[2, 2; 3, 1; 1406497, 1; 830370383, 1; 99450617953977436093324829, 1]490
141-9[2, 1; 2039, 1; 483241756040154301, 1; 1414548079303981253089, 1]840
142-111[2, 4; 3, 1; 1406497, 1; 830370383, 1; 99450617953977436093324829, 1]490
143-69[2, 1; 23, 1; 31, 1; 131, 1; 353, 1; 8893, 1; 177755497, 1; 277728329, 1; 385152161919299, 1]410
144-83[2, 2; 1700143, 1; 3279245510308636264940025379136984581, 1]20
145-151[2, 3; 3, 1; 5, 1; 67, 1; 798006697591, 1; 6951632199463154252028137287, 1]750
146-153[2, 1; 3, 1; 5, 1; 491, 1; 6055871065452986596479489008186927768087, 1]30
147-145[2, 1; 3, 1; 34301, 1; 161233, 1; 417523, 1; 174323135449, 1; 73868956290836867, 1]150
148-167[2, 3; 11, 1; 19, 1; 132657971690831, 1; 1608680259113069994569276309, 1]1730
149-31[2, 5; 3, 3; 5, 1; 7, 1; 13, 1; 17, 1; 19, 1; 37, 1; 73, 1; 97, 1; 109, 1; 241, 1; 257, 1; 433, 1; 577, 1; 673, 1; 38737, 1; 487824887233, 1]10
150-3[2, 2; 3, 1; 5, 1; 149, 1; 223, 1; 593, 1; 1777, 1; 25781083, 1; 184481113, 1; 231769777, 1; 616318177, 1]170
151-195[2, 2; 17, 1; 41977873314881172972302528513220445187727839, 1]30
152-17[2, 1; 7, 1; 17, 1; 62983, 1; 4991839, 1; 44227633, 1; 1725062259481544383088761, 1]160
153-69[2, 1; 13, 1; 17, 1; 31, 1; 833307658856201944859603543686758217126111, 1]20
154-243[2, 2; 3, 1; 5, 1; 13, 1; 1451, 1; 8093, 1; 81727, 1; 1208758919, 1; 25237278936719029457687, 1]140
155-31[2, 5; 3, 2; 7, 1; 11, 1; 31, 1; 151, 1; 251, 1; 331, 1; 601, 1; 1801, 1; 4051, 1; 100801, 1; 10567201, 1; 1133836730401, 1]40
156-143[2, 4; 13, 1; 19, 1; 21407, 1; 271506673682994863, 1; 3976729669784964390481, 1]920
157-19[2, 2; 3, 2; 565013, 1; 283127627, 1; 31722406732365708246533232867557, 1]1230
158-15[2, 4; 3, 1; 23, 1; 43, 1; 89, 1; 127, 1; 617, 1; 683, 1; 78233, 1; 35532364099, 1; 581283643249112959, 1]70
159-91[2, 2; 3, 1; 7, 1; 453553, 1; 84301218091, 1; 227524480117462744571759085503, 1]1360
160-47[2, 4; 71, 1; 40813, 1; 82963182251, 1; 379959277835395773058806460021, 1]1450
161-159[2, 5; 181, 1; 1609, 1; 15991, 1; 209060319214451, 1; 93820441463831721806779, 1]570
162-101[2, 1; 307, 1; 12209275712633, 1; 779831951475688142994810611932471, 1]6760
163-55[2, 3; 3, 3; 46020829, 1; 230938061, 1; 5093139709090657290362849823763, 1]200
164-63[2, 6; 3, 1; 2687, 1; 202029703, 1; 1113491139767, 1; 201487636602438195784363, 1]510
165-25[2, 1; 3, 2; 181, 1; 43913, 1; 458336239, 1; 713215708842851814477991561387801, 1]70
166-5[2, 1; 59573573, 1; 3218926687654133, 1; 243884697112256951372125781, 1]1580
167-135[2, 3; 2863345019, 1; 8166681291331467970489433122505775233821, 1]590
168-257[2, 1; 1385887, 1; 354062624131, 1; 381242554710766547265379727561867, 1]4270
169-643[2, 2; 3, 1; 11, 1; 2287, 1; 2478729705162984106876438083339086887890174577, 1]90
170-143[2, 4; 5, 1; 7, 1; 11, 1; 197, 1; 263, 1; 31177, 1; 69439, 1; 4323551, 1; 54561836281, 1; 9181829646439421, 1]100
171-19[2, 2; 3, 1; 373, 1; 100271, 1; 6669047866104325500594787895587024454736043, 1]20
172-95[2, 5; 5, 2; 239, 1; 1061, 1; 15263, 1; 1933374909205041859345518705365754560881, 1]30
173-55[2, 3; 3, 1; 53, 1; 811, 1; 296269, 1; 2409986827785043447, 1; 16254754097798812024831, 1]930
174-3[2, 2; 3, 1; 5, 1; 173, 1; 431, 1; 9719, 1; 101653, 1; 500177, 1; 2099863, 1; 1759217765581, 1; 2932031007403, 1]90
175-229[2, 1; 3, 1; 11, 1; 17, 1; 433, 1; 5303, 1; 1441548550921, 1; 12894888372628703287173138978851, 1]2980
176-233[2, 1; 19, 1; 100390812696683, 1; 25107395873362030653452226162419112763, 1]17300
177-339[2, 2; 43, 1; 443, 1; 269897, 1; 43417999, 1; 214540455246546428451705911111471989, 1]170
178-41[2, 1; 38461, 1; 4980680237337461514125825599796902003388949592391, 1]40
179-49[2, 1; 3, 2; 11, 1; 197, 1; 641, 1; 9619, 1; 30809, 1; 189875706144165757, 1; 544631616422353800199, 1]880
180-47[2, 4; 107, 1; 5920151, 1; 47545643, 1; 12399411469, 1; 256478448539413317884593007, 1]730
181-165[2, 1; 41, 1; 173, 1; 33861401473, 1; 6380641301623404260293530023063493488537, 1]1740
182-161[2, 1; 431, 1; 7639, 1; 669102391, 1; 40934005122337, 1; 33989017713868288731201457, 1]730
183-147[2, 2; 5, 1; 7, 1; 523, 1; 887, 1; 1035237779553371216351, 1; 182345793684253747191714659, 1]6940
184-33[2, 1; 3, 2; 347, 1; 32143427003, 1; 122130755781316693861449472063856783957039, 1]2950
185-303[2, 4; 7100671, 1; 431648090966582977399839262275441062856943835923, 1]80
186-371[2, 2; 7, 1; 11, 1; 373, 1; 881, 1; 14321, 1; 67665982492050085897207378640217002088350963, 1]70
187-85[2, 1; 3, 1; 7, 2; 84017, 1; 108161, 1; 14839871, 1; 16207518253569833, 1; 305265236392825045873, 1]510
188-125[2, 1; 5, 1; 13, 1; 397, 1; 1918919364716236391465881, 1; 3961399114926731715517839373, 1]23570
189-25[2, 1; 3, 3; 1227563, 1; 524793072442523, 1; 22555036659659199150862565259671041, 1]13800
190-11[2, 2; 11, 1; 4668159781, 1; 243343180651407107, 1; 31396526753320467221701278169, 1]6770
191-19[2, 2; 3, 1; 13, 1; 13757, 1; 3944813, 1; 379007533686944959, 1; 978152507894592399617628427, 1]4150
192-237[2, 1; 3, 1; 15739, 1; 309479, 1; 1142678623, 1; 187964352975314705242455686948494766561, 1]110
193-31[2, 5; 3, 1; 5, 1; 283, 1; 2351, 1; 3761, 1; 4513, 1; 13264529, 1; 7484047069, 1; 165768537521, 1; 140737471578113, 1]770
194-33[2, 1; 3, 1; 5, 2; 109, 1; 1120993, 1; 1369930393629556067951295927819449355800614521121, 1]40
195-135[2, 3; 7649737, 1; 2452958806703, 1; 334520246557246643906364340768470860089, 1]20650
196-15[2, 4; 3, 2; 5, 1; 7, 1; 13, 1; 17, 1; 97, 1; 193, 1; 241, 1; 257, 1; 641, 1; 673, 1; 65537, 1; 6700417, 1; 22253377, 1; 18446744069414584321, 1]120
197-75[2, 2; 137, 1; 577, 1; 6037, 1; 117496859, 1; 895581969324648364417023941445052237459747, 1]220
198-17[2, 1; 5647, 1; 6268111, 1; 5674853826681942056754247728019406574089602588439, 1]80
199-49[2, 1; 3, 1; 11, 1; 13, 1; 53, 1; 1439, 1; 23561, 1; 413407351547, 1; 6700904941889, 1; 188122098214963717375891, 1]10650
200-75[2, 2; 3, 2; 5, 2; 1973, 1; 4229, 1; 43481, 1; 4921441524559637294985132128164617176671474541, 1]40
201-55[2, 3; 3, 1; 167, 1; 373, 1; 524970661658113207, 1; 4095034364012227742853788935311573767, 1]34580
202-183[2, 3; 3, 1; 5, 1; 7, 1; 157, 1; 575359, 1; 132419253469, 1; 639720310844023611351180529144690508359, 1]16320
203-159[2, 5; 159713901631, 1; 2515338408004754911311634508555703462104415468869, 1]3150
204-167[2, 3; 701, 1; 2003, 1; 64203236540867, 1; 35651125041115722402818055390497311586431, 1]49480
205-81[2, 1; 5, 2; 23, 1; 43, 1; 83, 1; 253733, 1; 5427671, 1; 9097336384850252124159720263087428101924419, 1]60
206-5[2, 1; 1126397, 1; 8508294359, 1; 5365560786350470324266798915301651129633890023, 1]380
207-91[2, 2; 3, 1; 7, 2; 1351359109, 1; 6447420331263374581, 1; 40149026429055639173984371262843, 1]17370
208-299[2, 2; 11, 1; 179, 1; 930911, 1; 1331471, 1; 42139901560804743856900479669932824375331056501, 1]80
209-33[2, 1; 19, 1; 223, 1; 1889, 1; 3557, 1; 10651, 1; 19163, 1; 1078853, 1; 79448717, 1; 825965228710894362828097778503, 1]140
210-47[2, 4; 23, 1; 37, 1; 112921, 1; 369947, 1; 14056417, 1; 90762222332731247, 1; 2267543189131075664701547, 1]1550
211-175[2, 4; 3, 1; 83472648601, 1; 39007069683614531, 1; 21057185723372201121181744082314069, 1]28240
212-23[2, 3; 8792772968923, 1; 93571422982092467654057736798598978841081010309383, 1]6050
213-3[2, 2; 15193, 1; 60272956433838849161, 1; 3593875704495823757388199894268773153439, 1]191460
214-185[2, 1; 317, 1; 124058292389, 1; 540945037908779672551583, 1; 618800810497636303055388781, 1]21950
215-157[2, 1; 3, 2; 5, 1; 7, 1; 5641, 1; 23997473, 1; 254926367, 1; 16758582209, 1; 144522303784397092260567539423893, 1]830
216-377[2, 1; 13, 1; 32633, 1; 9982313543, 1; 206640513120169967, 1; 60173051501702045425514341939471, 1]13820
217-61[2, 1; 3, 1; 5, 1; 11, 1; 2260519, 1; 3423826184329638478080176899, 1; 82466060547863089674548055737, 1]85110
218-33[2, 1; 3, 1; 5, 1; 29, 1; 1487, 1; 325618321757321109996731914704977026393943202469058619157019, 1]60
219-121[2, 1; 3, 1; 19, 1; 7331538732970798685879, 1; 1008019806839100702034857699988907432049661, 1]761620
220-77[2, 1; 11, 1; 29, 1; 43, 1; 10729, 1; 5724672764986045690693560266306755552932768319387558211693, 1]60
221-3[2, 2; 7, 1; 439, 1; 3943, 1; 2298041, 1; 9361973132609, 1; 671165898617413417, 1; 4815314615204347717321, 1]24520
222-117[2, 1; 3, 3; 1010536301839123457339, 1; 123513195593586463868249598285337146648031981, 1]1463770
223-235[2, 2; 3, 3; 1010536301839123457339, 1; 123513195593586463868249598285337146648031981, 1]1487840
224-63[2, 6; 3, 1; 104124649, 1; 745988807, 1; 870035986098720987332873, 1; 2077756847362348863128179, 1]9440
225-49[2, 1; 3, 1; 7, 1; 61, 1; 27943, 1; 162601, 1; 5940989, 1; 892101237234038665147, 1; 873978534303771245583941719, 1]11440
226-5[2, 1; 53, 1; 47977, 1; 5979468433, 1; 36078102492307, 1; 98295537368972223482915638371315396139, 1]4620
227-405[2, 1; 107839786668602559178668060348078522694548577690162289924414440996661, 1]150
228-93[2, 1; 3, 1; 31237, 1; 626571587, 1; 404467716453060805507, 1; 9081631654249145670564546290497319, 1]59960
229-91[2, 2; 3, 5; 5, 1; 40591, 1; 3143029, 1; 53627527, 1; 2004564824464229, 1; 12943350847025909190036177872551, 1]8310
230-27[2, 2; 3, 1; 1373, 1; 5059, 1; 306329, 1; 52830590848430789043986747, 1; 1279113136179487092679920251063, 1]53980
231-165[2, 1; 1427957, 1; 39658511108291893, 1; 30468246982477978515515525373918516398562133141, 1]14160
232-567[2, 3; 3, 1; 47, 1; 427617987367, 1; 2044992909707736481033, 1; 6996842897906086565920734288250691, 1]86940
233-3[2, 2; 7, 2; 23, 1; 89, 1; 127, 1; 337, 1; 463, 1; 599479, 1; 581283643249112959, 1; 4982397651178256151338302204762057, 1]20110
234-83[2, 2; 5, 2; 816769, 1; 442138142271041, 1; 764472306154269432915984448077034681182685606499, 1]18780
235-15[2, 4; 7, 2; 23, 1; 89, 1; 127, 1; 337, 1; 463, 1; 599479, 1; 581283643249112959, 1; 4982397651178256151338302204762057, 1]20130
236-209[2, 1; 29, 1; 89, 1; 13544143745826932025021989329, 1; 1579462874256119876465031118434123019787, 1]1737680
237-181[2, 1; 3, 1; 5, 1; 97, 1; 75895492473298295944299720822290314253757899350327274833402328234219, 1]100
238-161[2, 1; 47, 1; 73, 1; 56346729743, 1; 23956921622110153, 1; 47685740029545205332343007648346758976959, 1]121680
239-87[2, 3; 5, 2; 7, 1; 43, 1; 73186307755556536589, 1; 200513046199026997866779165419871806377600800341, 1]755220
240-467[2, 2; 2207, 1; 388351518883, 1; 1573683962309, 1; 327487032512072551393739125381363838638459963, 1]13090
241-39[2, 3; 59, 1; 71, 1; 125948811448546516414213434444739, 1; 837210244930902750478699457171126909, 1]1981920
242-63[2, 6; 3, 1; 5, 1; 1181, 1; 2833, 1; 3541, 1; 37171, 1; 157649, 1; 174877, 1; 179951, 1; 5521693, 1; 1824726041, 1; 104399276341, 1; 3203431780337, 1]510
243-9[2, 1; 1059474334145137324096576187719, 1; 6670655466907588375704838543306822887023021, 1]15392250
244-189[2, 1; 3, 1; 197, 1; 11393, 1; 57847, 1; 51954001027703, 1; 253585377306339492449179, 1; 2754478086488356140570509, 1]20050
245-163[2, 2; 3, 1; 11, 2; 10158033271, 1; 2651913793989357523, 1; 1445483997329846220738961002758581843746673, 1]314370
246-107[2, 2; 11, 1; 23, 1; 9382223, 1; 208018359877, 1; 57252044712790847451834254170647452144376636229403003, 1]9950
247-81[2, 1; 43, 1; 59, 1; 19219, 1; 23063, 1; 42043, 1; 5317979, 1; 148238165219161, 1; 3033971756400556566256483326377811571, 1]23330
248-237[2, 1; 3, 3; 2117141551592677249, 1; 1634569665398669094989107, 1; 2420426137301208737721039667369, 1]76900
249-75[2, 2; 265561467247, 1; 851616112217379844753490755648602262694659613077443581863618147, 1]15710
250-207[2, 4; 3, 1; 17, 1; 2217219845996403864575118432304838921822724890196855163132996017308385601, 1]110
251-9[2, 1; 19, 1; 3121, 1; 30510656070643106182115999270826633842178510774222732476374386585332681, 1]60
252-129[2, 1; 3, 1; 43, 1; 41953, 1; 4979420713, 1; 12036730438063937, 1; 34400489300742979, 1; 324283015810421005973242541, 1]140700
253-273[2, 1; 3187, 1; 913180633, 1; 696298366925826656521, 1; 3571287181702555779736074641734730653395149, 1]433400
254-245[2, 1; 79, 1; 3539, 1; 701731, 1; 974497, 1; 75705961582336032110452308695156564214088210230278680011907, 1]130
255-19[2, 2; 3, 1; 65147, 1; 74058212732561358302231226437062788676166966415465897661863160754340907, 1]60
256-189[2, 1; 3, 1; 29, 1; 222587, 1; 1521613, 1; 4463413, 1; 440208639276132997491800604758226661590679912188273141493, 1]170
257-93[2, 1; 9340679, 1; 81341356685870606963191, 1; 152401426061351045623332230958307016527107478801, 1]2073100
258-87[2, 3; 3, 1; 61, 1; 10293527, 1; 30735026829701555603368594197526649635100056671893194944473989691077, 1]100
259-361[2, 1; 3, 2; 13, 1; 3958703905549271638412683248160270353957948193697113300494276376338910415039, 1]170
260-149[2, 1; 39677838514980433, 1; 124254106796695169449, 1; 187892791897923671034965331643020450024989, 1]391020
261-223[2, 5; 3, 2; 1213, 1; 10606585072576366714625903179324714468560042563491853443203955666200708037, 1]130
262-71[2, 3; 7, 1; 132333816271218509055509697152786180403737125332160644616522953151900719588497, 1]80
263-747[2, 2; 5, 1; 13, 1; 23, 1; 2529295193, 1; 3186807992298761219, 1; 307490894123975068695172205186684212362429372841, 1]8140
264-275[2, 2; 5, 1; 48142021, 1; 8014734557, 1; 351834291989734327369, 1; 10917852734093742584596187716460542066519, 1]300430
265-49[2, 1; 3, 1; 211, 1; 569, 1; 14401, 1; 61519, 1; 4095144101, 1; 180005696950598015171, 1; 126021754756267282721431236694402967, 1]60410
266-3[2, 2; 3, 2; 5, 1; 7, 1; 13, 1; 17, 1; 23, 1; 67, 1; 89, 1; 241, 1; 353, 1; 397, 1; 683, 1; 2113, 1; 7393, 1; 20857, 1; 312709, 1; 599479, 1; 4327489, 1; 1761345169, 1; 2931542417, 1; 98618273953, 1]300
267-265[2, 1; 3, 1; 1285279, 1; 30751066338906905067236163937660336171303004846318954244280701187343511863, 1]150
268-77[2, 1; 853, 1; 4007, 1; 6998239166167, 1; 1685101657977964436098042916777, 1; 5883362151411780955219936413101, 1]204950
269-241[2, 1; 3, 1; 5, 1; 7, 2; 79, 1; 2897, 1; 36070621, 1; 192835543, 1; 10070723387194654603958653, 1; 40250802230324898226095552713353, 1]81910
270-53[2, 1; 5, 1; 245264233171428526706685759014508458783, 1; 773507643382382537940525445158357764634239, 1]75888120
271-169[2, 1; 3, 1; 7, 1; 202962937, 1; 2185050859, 1; 203704792088832476693249566666783482639927151412207570223511973, 1]1050
272-237[2, 1; 3, 2; 47, 1; 1213, 1; 213181, 1; 19228060908107, 1; 1804029655689525238778676850714730275291908477571365155813, 1]13320
273-205[2, 1; 3, 2; 11, 1; 17, 1; 17175751, 1; 104638110402919681507, 1; 2508817560202076618330089426158127322883090836024503, 1]125580
274-305[2, 1; 3461, 1; 363169397, 1; 1330216529599, 1; 48129287350697028587, 1; 188601959565003541591329310209313129459, 1]114840
275-129[2, 1; 7, 1; 1171, 1; 57119, 1; 81023, 1; 121012487, 1; 23126572387998467, 1; 285912738310404055442558568140607061991977799, 1]14220
276-89[2, 1; 93151, 1; 15424926104694984601832839, 1; 42251116898694971565898093095827558920898935636831307, 1]27730220
277-103[2, 3; 3, 1; 4921643, 1; 1192043179595340983, 1; 1724628115307254008646926255474975700090285775089771612453, 1]279650
278-93[2, 1; 3, 4; 5, 2; 35845756259, 1; 1020823525559, 1; 142969853587413697146749, 1; 22921914141647811312957090726603001, 1]103830
279-69[2, 1; 1091, 1; 18941102166895071951474817120841, 1; 23502215132880195699760075340804878804639464756839, 1]929930
280-47[2, 4; 2267, 1; 15794983571, 1; 7172895177104937152863597, 1; 472730496784237941410822264147481185833429777, 1]1611470
281-139[2, 2; 3, 2; 5490011, 1; 143729353, 1; 562853636631138634964038847, 1; 243003270776073371049230173446170609911817, 1]1077950
282-83[2, 2; 5, 1; 983, 1; 196601219, 1; 141939161168963956627, 1; 14164029517496545688104807449480969946608408362803889, 1]196730
283-45[2, 1; 886801991827, 1; 28989724280495264772289, 1; 302265118624242077340553796531431025151515415126227, 1]11281030
284-173[2, 1; 457, 1; 3074677, 1; 2664231423869737, 1; 282340299704142310324867201811, 1; 14703754939989480218346599059927, 1]287540
285-9[2, 1; 11, 1; 12964024748501, 1; 217964734076932156111514568114904890024605669950045660233263463447244301, 1]30180
286-165[2, 1; 3, 1; 13, 1; 17, 1; 59, 1; 13395601, 1; 17357077, 1; 6835093044285482403773059278573741467423440621375941396611526528461, 1]410
287-115[2, 2; 3, 1; 7, 2; 623947, 1; 91145996311, 1; 7436115590292125746476231065146276500165929614318792669020552211397, 1]4160
288-167[2, 3; 11, 1; 30915205271, 1; 195588395871442085084354141883375067, 1; 934632459328397434628283569822381681093, 1]7637820
289-493[2, 1; 3, 1; 83, 1; 439, 1; 1663, 1; 2735789224587787135900106826927580222007840642103286271103142487714316816383113, 1]260
290-47[2, 4; 179, 1; 239, 1; 55487, 1; 85210324931, 1; 1965027863636852423, 1; 312806413638366750800158403702068227763702463651, 1]1033260
291-19[2, 2; 3, 1; 585348671, 1; 566412534441700466029169189141082990631699524603912206758860112958964358313239, 1]650
292-167[2, 3; 19, 2; 5737779741503, 1; 493552660435552898930183770513, 1; 972935779863472462574038604741160792087229, 1]6585870
293-601[2, 1; 3, 1; 5, 1; 11, 1; 19, 1; 313, 1; 613, 1; 1779459827673225293, 1; 20885553271567040505321151, 1; 355944432370928964769077766990274891, 1]321850
294-35[2, 2; 7, 1; 181, 1; 2243, 1; 160117, 1; 344954433409, 1; 115289130136570835298221037503, 1; 439708952144660222372920943482895053, 1]705580
295-171[2, 2; 29, 1; 281, 1; 2659, 1; 3923, 1; 192111793130234469727, 1; 974526696113978976231067895091423651990398630487821207159, 1]241700
296-285[2, 1; 3, 1; 5, 2; 29, 1; 61, 1; 44686146935516329, 1; 112855644192873231433667012161, 1; 95140062250539485941555268720020375427, 1]1363510
297-123[2, 2; 97, 1; 226539943991, 1; 889210334327413690555212288427, 1; 3257824585446778203730453804073522631754188053, 1]14728090
298-341[2, 1; 254629497041810760783555711051172270131433549208242031329517556169297662470417088272924501, 1]240
299-69[2, 1; 7236263729652930604873, 1; 70375958244413911490548060385575964981946839433155608010982460524533, 1]8197830
300-153[2, 1; 3, 4; 73, 1; 34267, 1; 3930559, 1; 34611060765077437061484737160485718539, 1; 36950090843062825976378737529596481741, 1]7633740
301-265[2, 1; 3, 1; 11, 1; 173, 1; 197, 1; 653, 1; 1399, 1; 4957, 1; 399965576937104166381732366243036359049354126779234239327680973473089061829, 1]190
302-267[2, 2; 3, 1; 11, 1; 17, 1; 2071645309265520077, 1; 406212279849849780121, 1; 4314866753718196817431654642039004568780931874857, 1]1267630

Monday, January 03, 2005

ECC factorizations

Let the minus-one-factorization of a prime P be the factorization of P-1. Below are the minus-one-factorizations of the prime moduli for the Certicom Elliptic Curve Cryptography (ECC) Challenges over prime fields, and the recursive minus-one-factorizations of each large prime factor. If a number is followed by a parenthesized expression, the parenthesized expression, ignoring any parenthesized expressions within it, is the minus-one-factorization of the number.

;; ECCp-131
1550031797834347859248576414813139942411 ( 2 5 155003179783434785924857641481313994241 ( 2 2 2 2 2 2 2 2 2 3 5 20182705700968071083965838734546093 ( 2 2 3 3 13 23 31 691 1063 35425647529 (2 2 2 3 1476068647 (2 3 13 13 211 6899)) 2324421561859 ( 2 3 11 5591 6299143 (2 3 1049857 (2 2 2 2 2 2 2 2 3 1367))))))

;; ECCp-163
7441570001851253078325059510076520610606604922267 (2 3 19 281082065814119 (2 4021 34951761479 (2 9341 1870879 (2 3 79 3947))) 232234417559633389665439706088451 (2 3 5 5 199 601 1517753 (2 2 2 193 983) 42683677 (2 2 3 7 23 22093) 199822713017 (2 2 2 13709 1822003 (2 3 7 13 47 71) )))

;; ECCp-191
3088527565889291933677698411347346523477823907719021786597 (2 2 7 64817 176597 2831642591 (2 5 7 71 569747) 612429643268111 (2 5 61 3533 10831 26237) 5556822995668202328643 (2 3 11 13 13 37 13464623031049829 (2 2 11 11 11 17 181 821918311 (2 3 5 27397277 (2 2 1979 3461)))))

;; ECCp-239
862591559561497151050143615844796924047865589835498401307522524859467869 (2 2 79 97 683 32914695791553889 (2 2 2 2 2 3 13 26373954961181 (2 2 5 6481 11681 17419)) 1251802568002522287870807195430320302070461232107 (2 83 7949 17337811 (2 3 5 7 82561) 1865415619 (2 3 3 11 11 47 18223) 14584787891 (2 5 1458478789 (2 2 3 13 13 29 24799)) 2011153700906761 (2 2 2 3 5 16759614174223 (2 3 19 63607 2311289 (2 2 2 7 149 277)))) )

;; ECCp-359
815061317237192195822186322581994619328922585201839923945006339195983201432548797517008668016697623370770793 ( 2 2 2 59 18761087 (2 29 323467) 32129831 (2 5 17 188999) 2864717788343148103646536857871784899879148861068940844995306009883386685231752208772094863 ( 2 3 127 265921867653623936056279 ( 2 3 3 14773437091867996447571 (2 5 7 17 2477987 (2 7 263 673) 5009975039569 (2 2 2 2 3 104374479991 (2 3 5 11 3797 83299))) ) 14137506615578070034728506896758540845078851196564075028357231269 ( 2 2 19 67 67 5414567 (2 2707283 (2 1353641 (2 2 2 5 43 787))) 677259217957139 (2 127 389 8951 765773) 1246739038251570197 (2 2 113 733 3762990734681 (2 2 2 5 226463 415409)) 9063906319214216867 (2 11 823 6301 79448081161 (2 2 2 3 5 7 61 1550509 (2 2 3 129209))))))

The most difficult factorization was 283..863 in ECCp-359, after dividing by 762 has a large composite 3759472163179984387987581178309429002466074620825381686345545944728853917626971402588051.

Thursday, December 30, 2004

Platykurtosis

Is there a canonical heavy-tailed distribution? Perhaps Student's t? -- Mobile Email from a Cingular Wireless Customer http://www.cingular.com

Circle, ellipse, ...

A circle is a loop with 1 DOF: radius. Ellipse has 2 DOF. What is a closed curve with 3 DOF? I'm thinking oval-like. -- Mobile Email from a Cingular Wireless Customer http://www.cingular.com

Monday, December 20, 2004

Primitive Roots of Selected Large Primes

PrimeMinimum GeneratorApprox log2
59656*2^59656+1359671.9
32292*2^32292+1532307.0
18496*2^18496+1318510.2
1477!+1148113426.3
1706595*2^11235+11311255.7
2897*2^9715+139726.5
872!+19837266.0
6611*2^6611+136623.7
4713*2^4713+154725.2
427!+14673120.8
399!+14092877.4
340!+13472374.2
2^2281-132281
320!+13672206.8
2^1279-151279
154!+1163901.9
2^607-15607

Many of the entries are Cullen primes. The 211235 entry was mentioned earlier, also see the post about Mersenne Primes. It appears that the minimum primitive root of X factorial plus 1 is always greater than X.

The C18496 entry took 2.72 days on an Athlon 700, with Pari/GP 2.1.3, most of the time which was spent on proving its primality, even though I already knew it was prime. Later I learned about that one can essentially assert primality of P for znprimroot with addprimes(P).

The 29715 entry came from the Sierpinski problem.

The factorial primes 427 and greater used the following gp code, which relies on the conjecture that the least primitive root is greater than n, and is prime. m=n!; forprime(root=n, n+10000, print("root=",root); fl=0; forprime(p=2,n, if((Mod(root,m+1)^(m/p)==Mod(1,m+1)), print("      unhappy at ", p); fl=1; break)); if(fl==0,break))

Saturday, December 18, 2004

Period

The period ``.'' serves four purposes in English: a sentence terminator, an abbreviation mark (``Mr.'') , a decimal point (``3.14''), and one-third of ellipses (``...''). First here's a silly quiz. Complete the sentence with the appropriate punctuation:

The clock read 4:20 p.m., 4:21 p.m., 4:22 p.m

  • ...
  • ....
  • .....

This multipurpose use makes automated parsing nontrivial. However, in LaTeX, one can introduce a macro, \newcommand{\STOP}{.} that will take us back to the telegraph days\STOP It's still a little tricky to end a sentence with an abbreviation, however, perhaps even that can be fixed by something that detects whether the last character was a period\STOP LaTeX already has \ldots for ellipses\STOP

The clock read 4:20 p\abbreviationperiod m\abbreviationperiod, 4:21 p\abbreviationperiod m\abbreviationperiod, 4:22 p\abbreviationperiod m\abbreviationperiod\ldots\STOP

Rubik's Attack

Let ENC and DEC be cipher encryption and decryption steps, not necessarily respectively. Consider the operation

  c=ENC(k,p)
  c'=c XOR mask
  p'=DEC(k,c')

or the operation

  c=ENC(k,p)
  k'=k XOR mask
  p'=DEC(k',c)

where c, p, c', p', and mask are all known. Can k be recovered with enough examples?

This is named after many Rubik's cube operations are of the form AXA-1; that is, first do a preparation, then do something, then undo the preparation.

Wednesday, December 15, 2004

Sequence A016027

The values of N such that the N-th prime number is a Mersenne prime exponent. Probably the most compressed representation of thousands of years of computation of Mersenne primes.

Update (2011): The first differences A135701 are slightly more compressed: 1 1 1 2 1 1 3 7 6 4 3 67 13 96 121 11 116 128 19 594 30 131 897 181 156 2033 3760 2105 1842 6961 41453 7556 28716 9974 108217 3031 256669 402707 452111 179537? 113178? 258898? 126198? 263183? 313608? 26616?

19 594 30 are the 4253 4423 9689 9941 gaps.

Mass-Energy equivalence

% units
2084 units, 71 prefixes, 32 nonlinear units

You have: g c^2
You want: kiloton tnt
        * 21.480764
        / 0.046553278

You have: gigaton tnt
You want: lb c^2
        * 102.63241
        / 0.0097435108 

So, one gram is equivalent to 21 kiloton TNT (about the Nagasaki atomic bomb), and small 100 pound person is a 1000 megaton nuclear weapon, far larger than has ever been constructed.

Tuesday, December 14, 2004

Primitive root of an 11,000-bit prime

13 is the least primitive root of 1706595*211235+1, as reported by a 5-hour computation of znprimroot using Pari/GP. The prime is one of a twin-prime pair discovered in 1989.

Saturday, December 11, 2004

Verhoeff PIDs

Let process ID numbers always have a check digit appended to them so you don't accidentally typo and kill -9 the wrong process. -- Mobile Email from a Cingular Wireless Customer http://www.cingular.com

Wednesday, December 08, 2004

Speex and gz

Does Speex have a lossless compression step, eg RLE, that can be skipped in favor of an off-the-shelf gz or bz2? -- Mobile Email from a Cingular Wireless Customer http://www.cingular.com

Monday, December 06, 2004

Interesting bitstrings

Here's the 5-bit version:

00001
00010
00100
01000
10000

11110
11101
11011
10111
01111

00001
00011
00111
01111
11111

11110
11100
11000
10000
00000

So it looks like about 4*n for n bits. So approximately 512 for 128-bit (AES). The related-key related-ciphertext related-plaintext challenge will have 2*512*512=500,000 lines. (The factor of 2 for encrypt/decrypt).

Binary strings

Saturday, December 04, 2004

barbital + shanties = throbbed

Encrypting the plaintext ``barbital'' with the key ``shanties'' using the simple cipher a=(leave char unchanged) b=(forward one letter in the alphabet) b=(forward two letters)... yields the ciphertext ``throbbed'' which is the longest (and unique instance of length 8) in Linux's /usr/share/dict/words in which all three are English words. It also works swapping the plaintext and key.

Thursday, December 02, 2004

Aspect 2

Given integer X, find integers m and n s.t. mn>X, 2m>=n>=m, minimizing mn-X. -- Mobile Email from a Cingular Wireless Customer http://www.cingular.com

Monday, November 22, 2004

Upload progress bar

Web browsers have download progress bars; why can't they have upload progress bars? -- Mobile Email from a Cingular Wireless Customer http://www.cingular.com

Thursday, November 18, 2004

Punch card printer

A printer that can both print ink and make holes in paper. -- Mobile Email from a Cingular Wireless Customer http://www.cingular.com

Tuesday, November 16, 2004

Gridlock

A sliding block puzzle game

Thursday, November 11, 2004

World's Strongest Chessman

Combine ``Rapid Chess'' with the ''World's Strongest Man'' competition. Let the board be populated with very heavy life-sized pieces (perhaps made of stone) which the two players have to move around to checkmate the opponent. Imagine the strategy: By chasing the (say) very heavy queen all over the board, one player can force the other to run out of time on the clock. The trick will be finding strongmen who play chess, though.

Monday, November 08, 2004

802.11{b,g} cell phone

How difficult would it be to make a mobile telephone that communicates over Wifi (802.11b or its successors) and works over AIM (iChat AV) or Netmeeting (that is, it doesn't have a phone number). And deploy in a place like MIT that has wireless everywhere free for students.

Tuesday, November 02, 2004

Clipped Circle

The area of a circle clipped by a square as its radius increases from 1 to sqrt(2) is 0.25*A = h + (pi/4 - atan(h))*r^2, where h=sqrt(r^2-1) (Dimensions sure are funny, aren't they.)

Quarter Circle Clipped by Square

Saturday, October 30, 2004

Haskell GD linking example

Demonstration of linking the GD Graphics Library (in C) with some Haskell code, using the tool C->Haskell c2hs.
begin 644 haskell-gd.tar.bz2
M0EIH.3%!629368B6U`@``X5_TLZ0`)!\]__?/^_>RO__W_H`(`$`0```"%`$
MO=CF;F-3S9J-7IX))$U,T@4;4\IYIH%'B0;4/2-I#U-`--#30T\IY0"4IHQ2
M;4>U--JC]4]0]0``]0`-&@`````D2""3U3&"GI/4&GJ`VHTT````:```-J2G
MI">*>H!IY1H'J-```!Z@&@#30`>H))3*&(F>J,TC$T:&@``!HT````!0%-OT
M.ETT6,93%8NC,D\<S(30H0/9"%*R1NF[RC5JFEB2=K=(E8]0Y6P,E+-8E5):
M$FD)R7PWC^%U.L=SXK52<?OJZ/]<DZ(D2EVYXL)7/Q"P3[)5CAUP*@\@K8#T
MN^/+)%*L1F"MDPNORCKD/<;HS_<N^:H2%62T1F-H\>1+MZP[8RVZ6NE2;XT"
MK^S5"M#>/J;1<Y+:&M*0G=<9$N\,>*%,!>ZLU9!8O#'&C<Y;4F_,PL'N4T'&
MEN!9?GJD8_"B<0+X4%:HSB)1<K6/F'7I1;IR6[>6F28Q;._&O63<D;S2^##`
MY1"N&8SHYZT)#K$#E26@VM1<3+=P<;%LM'!1C;>T>58][)EP%Z&+?&+:3)45
M=5D)&L)E9O.I9HIQ(T@7.)_1CT9>3QJ,5IB*BD/L<<?;]*/5,XGL(E$E7TUG
MLGO>F$%&Z@HNN#"1<DN.5R`(`S%")<@,AJD;7K/15"KQ>S^QSK[AA4:"Q*VU
MW8DHJ1+V62=-9NHXETZM0UEMOE*^6%82L"W#8N2<TKG952FA42G.5$7-*KG$
M%*WW'MG]'>3J0JW3V"E+K*P32<Z1B-!XP@UFHD=P@P&P>9\@Y#I@/S*:^5+%
M<ZX;CJ(I62)A?\LW4^M[?TY\NE!V6JOBD04TGLTYLV'"6T9UMM'X*&O[7D6'
M>B&LN.WI<*!J/VQ<[$@W#-TRY#'*6B=W+P4-?X+UMSR4G,'2Y(H.,6)"L$4H
M)2#S,IU2Y:G&`WBW3%D@3I95[P?T:ARVB>E2+X0+:1?EI))KQ9A*1,L"G*J`
MN8YX[#Z340S"(D#F1*YE9+K)$FM5&K.!5#E1`E**%T(5ZJK5N^]G\>8;SWPY
MP54%3"JT40LR[A>3)UCD0/D,P]*M%:CG,LQ/GL`N-,,F&3,\<*F!C*1U]/+O
M`9##-.0)50J$*1,)0M?2JE%1BT[-*,&N3GLP\<,#E:+D[)K$">JB=;9@PC6N
MG]_?FEW2M?1%6N)5ZM<9M;.<S*Z4!26J%=SD]`7H+1>\%1FF+8HF2SD*.`51
M@G?&JE/84P\*9&0'(-=*JL$3(+BB+!7U$^NPZ:1BA*PP#$A@H>^J89O0)C\2
MM*-1A[XQ(0%,`Q?P![IF%,A,A)AT35"(;"&0,9>DR6C!YB-PD92A"SKI&!GY
MV$<A;10B5D5ZXA/6K/*E<+97400%<8M+&HT$JQE`X<K,`LY/`V2M4UO(5O!>
M4+E7O/F8D*TVS.;!@K2],1'B6",4"XVHHHK,%'3%42]NR3NDKS1J`R"5/J3)
MM22?XT@52EC&5@X@MF%1T&#7'&0.0F*MT$)#2JE"2<#N-)Q;#'C>D/U:,8Q@
M\"&Q&DIC))Q,61$28D5BD,6L]%6SH5R6`>*U+(*RI\.E3)6XY"(6M':0C_%W
))%.%"0B);4"`
`
end

haskell-gd

Friday, October 29, 2004

Verhoeff Digit Checksums

As mentioned in Numerical Recipes. Here are the checksummed 1- 2- and 3-digit numbers (more at the link above): 07 19 26 34 40 51 63 72 85 98 008 010 024 036 043 051 069 072 085 097 103 116 121 134 149 155 167 178 180 192 209 214 225 231 247 250 262 273 286 298 307 311 320 335 342 356 368 379 384 393 402 415 426 430 448 454 463 477 481 499 505 512 529 537 541 553 564 570 588 596 600 618 627 632 645 659 661 676 683 694 706 713 722 738 740 757 765 774 789 791 804 819 828 833 846 852 860 871 887 895 901 917 923 939 944 958 966 975 982 990 0003 0011 0025 0032 0040 0057 0069 0076 0084 0098 0104 0116 0127 0139 0148 0155 0162 0171 0183 0190 0206 0212 0229 0231 0244 0258 0265 0273 0280 0297 0305 0318 0323 0330 0342 0356 0364 0377 0389 0391 0409 0417 0426 0434 0441 0453 0460 0478 0485 0492 0508 0514 0520 0537 0545 0552 0566 0579 0581 0593 0600 0613 0628 0635 0647 0659 0661 0672 0686 0694 0707 0710 0724 0738 0749 0751 0763 0775 0782 0796 0802 0815 0821 0833 0846 0854 0868 0870 0887 0899 0901 0919 0922 0936 0943 0950 0967 0974 0988 0995 1009 1017 1026 1034 1041 1053 1060 1078 1085 1092 1105 1118 1123 1130 1142 1156 1164 1177 1189 1191 1208 1214 1220 1237 1245 1252 1266 1279 1281 1293 1306 1312 1329 1331 1344 1358 1365 1373 1380 1397 1400 1413 1428 1435 1447 1459 1461 1472 1486 1494 1502 1515 1521 1533 1546 1554 1568 1570 1587 1599 1601 1619 1622 1636 1643 1650 1667 1674 1688 1695 1703 1711 1725 1732 1740 1757 1769 1776 1784 1798 1804 1816 1827 1839 1848 1855 1862 1871 1883 1890 1907 1910 1924 1938 1949 1951 1963 1975 1982 1996 2000 2013 2028 2035 2047 2059 2061 2072 2086 2094 2106 2112 2129 2131 2144 2158 2165 2173 2180 2197 2202 2215 2221 2233 2246 2254 2268 2270 2287 2299 2308 2314 2320 2337 2345 2352 2366 2379 2381 2393 2401 2419 2422 2436 2443 2450 2467 2474 2488 2495 2504 2516 2527 2539 2548 2555 2562 2571 2583 2590 2607 2610 2624 2638 2649 2651 2663 2675 2682 2696 2709 2717 2726 2734 2741 2753 2760 2778 2785 2792 2805 2818 2823 2830 2842 2856 2864 2877 2889 2891 2903 2911 2925 2932 2940 2957 2969 2976 2984 2998 3001 3019 3022 3036 3043 3050 3067 3074 3088 3095 3108 3114 3120 3137 3145 3152 3166 3179 3181 3193 3204 3216 3227 3239 3248 3255 3262 3271 3283 3290 3302 3315 3321 3333 3346 3354 3368 3370 3387 3399 3407 3410 3424 3438 3449 3451 3463 3475 3482 3496 3505 3518 3523 3530 3542 3556 3564 3577 3589 3591 3603 3611 3625 3632 3640 3657 3669 3676 3684 3698 3700 3713 3728 3735 3747 3759 3761 3772 3786 3794 3806 3812 3829 3831 3844 3858 3865 3873 3880 3897 3909 3917 3926 3934 3941 3953 3960 3978 3985 3992 4007 4010 4024 4038 4049 4051 4063 4075 4082 4096 4102 4115 4121 4133 4146 4154 4168 4170 4187 4199 4205 4218 4223 4230 4242 4256 4264 4277 4289 4291 4304 4316 4327 4339 4348 4355 4362 4371 4383 4390 4403 4411 4425 4432 4440 4457 4469 4476 4484 4498 4506 4512 4529 4531 4544 4558 4565 4573 4580 4597 4609 4617 4626 4634 4641 4653 4660 4678 4685 4692 4701 4719 4722 4736 4743 4750 4767 4774 4788 4795 4808 4814 4820 4837 4845 4852 4866 4879 4881 4893 4900 4913 4928 4935 4947 4959 4961 4972 4986 4994 5002 5015 5021 5033 5046 5054 5068 5070 5087 5099 5107 5110 5124 5138 5149 5151 5163 5175 5182 5196 5200 5213 5228 5235 5247 5259 5261 5272 5286 5294 5301 5319 5322 5336 5343 5350 5367 5374 5388 5395 5408 5414 5420 5437 5445 5452 5466 5479 5481 5493 5509 5517 5526 5534 5541 5553 5560 5578 5585 5592 5606 5612 5629 5631 5644 5658 5665 5673 5680 5697 5704 5716 5727 5739 5748 5755 5762 5771 5783 5790 5803 5811 5825 5832 5840 5857 5869 5876 5884 5898 5905 5918 5923 5930 5942 5956 5964 5977 5989 5991 6004 6016 6027 6039 6048 6055 6062 6071 6083 6090 6103 6111 6125 6132 6140 6157 6169 6176 6184 6198 6201 6219 6222 6236 6243 6250 6267 6274 6288 6295 6307 6310 6324 6338 6349 6351 6363 6375 6382 6396 6402 6415 6421 6433 6446 6454 6468 6470 6487 6499 6500 6513 6528 6535 6547 6559 6561 6572 6586 6594 6608 6614 6620 6637 6645 6652 6666 6679 6681 6693 6705 6718 6723 6730 6742 6756 6764 6777 6789 6791 6809 6817 6826 6834 6841 6853 6860 6878 6885 6892 6906 6912 6929 6931 6944 6958 6965 6973 6980 6997 7005 7018 7023 7030 7042 7056 7064 7077 7089 7091 7109 7117 7126 7134 7141 7153 7160 7178 7185 7192 7207 7210 7224 7238 7249 7251 7263 7275 7282 7296 7303 7311 7325 7332 7340 7357 7369 7376 7384 7398 7404 7416 7427 7439 7448 7455 7462 7471 7483 7490 7501 7519 7522 7536 7543 7550 7567 7574 7588 7595 7602 7615 7621 7633 7646 7654 7668 7670 7687 7699 7706 7712 7729 7731 7744 7758 7765 7773 7780 7797 7800 7813 7828 7835 7847 7859 7861 7872 7886 7894 7908 7914 7920 7937 7945 7952 7966 7979 7981 7993 8006 8012 8029 8031 8044 8058 8065 8073 8080 8097 8100 8113 8128 8135 8147 8159 8161 8172 8186 8194 8203 8211 8225 8232 8240 8257 8269 8276 8284 8298 8309 8317 8326 8334 8341 8353 8360 8378 8385 8392 8405 8418 8423 8430 8442 8456 8464 8477 8489 8491 8507 8510 8524 8538 8549 8551 8563 8575 8582 8596 8604 8616 8627 8639 8648 8655 8662 8671 8683 8690 8708 8714 8720 8737 8745 8752 8766 8779 8781 8793 8801 8819 8822 8836 8843 8850 8867 8874 8888 8895 8902 8915 8921 8933 8946 8954 8968 8970 8987 8999 9008 9014 9020 9037 9045 9052 9066 9079 9081 9093 9101 9119 9122 9136 9143 9150 9167 9174 9188 9195 9209 9217 9226 9234 9241 9253 9260 9278 9285 9292 9300 9313 9328 9335 9347 9359 9361 9372 9386 9394 9406 9412 9429 9431 9444 9458 9465 9473 9480 9497 9503 9511 9525 9532 9540 9557 9569 9576 9584 9598 9605 9618 9623 9630 9642 9656 9664 9677 9689 9691 9702 9715 9721 9733 9746 9754 9768 9770 9787 9799 9807 9810 9824 9838 9849 9851 9863 9875 9882 9896 9904 9916 9927 9939 9948 9955 9962 9971 9983 9990

Monday, October 25, 2004

CVS on su

Every time you use the su command (or sudo) you can make a RCS-style comment entry of what you did with the privilege. A separate idea: whatever your system's ``control panel'' is has the ability to roll back changes to a previous version (and form branches and stuff, like CVS).

Between Spreadsheet and Database

There's some area in between Spreadsheet and Relational Database that would make a good software product: something a little more smart and elegant about multiple different Tables than a spreadsheet, and a little more smart and elegant about math than a database.

Thursday, October 21, 2004

Modular Exponentiation Permutations

Consider the seqence N[1]=1, N[i+1]=g^N[i] mod P, where P is a prime and g is a generator (primitive root). For what {P,g} do the sequence of N's repeat with the maximum period length P-1?

P versus NP

It's interesting that P=NP can be proved or disproved by a single example or counterexample in either direction. It can be disproved by finding a single counterexample of a problem that is NP but not P. By the magic of computability theory, it can also be proved by finding a single example of an NP-complete problem that can by solved in deterministic polynomial time.

I know of of no other hard, unsolved, problems that have this property. Usually the counterexample is ``easy'' but the proof is hard.

Furthermore, instead of explicitly finding an example or counterexample, one only needs to show existence. However, how frustrating will it be if someone proves the existence of an NP-complete problem solvable in poly-time without constructing an example?

Monday, October 11, 2004

Diffie-Hellman Challenge

Find the value of x, 1440<=x<M-1, which minimizes the value of y=(3^x % M), where % is the "modulo" or "take the remainder" operator, and M=2^2281-1. M is the 17th Mersenne prime. 3 is a primitive root of M. The value 1440 makes 3^x loop around and the modulo operation take effect, i.e., 3^1440>M. This could be solved once and for all by solving the discrete logarithm problem 3^x == 2 (mod M). If this challenge gets solved, or is too easy, then do the same thing with 3^x % M21701, where M21701=2^21701-1 is also a Mersenne prime. By some analysis I don't fully remember, I have reason to believe that 3 is probably a primitive root of M21701. (I think the reasoning was that if 3 is not primitive, it gets eliminated from consideration by some small factor of M-1, and the small factors of M21701 were tested.) And if that's still too easy, try the modulus P=5359*2^5054502+1, which is a prime number found by the Seventeen or Bust project. I don't know the least primitive root of P, but it should be pretty easy since P-1 factors trivially.

Update: Pohlig-Hellman makes this a bad idea.

Sunday, October 10, 2004

Substrings of decimal expansions

Consider the first occurrence of a substring in the decimal expansions of all fraction a/b with 2<=b and and 1<=a<b, with fractions first sorted by b then by a, that is, 1/2, 1/3, 2/3, 1/4, 2/4, 3/4, ... For example, the substring "435" first occurs in the expansion of 14/39=.35897435897. Among three digit substrings, the last to occur are 999: 999/1000 = 0.999... (001,499): 1/501 = .0019960079840319361277445109780439121756487025948103792415169660678642714570858283433133732534930139720558882235528942115768463073852295409181636726546906187624750499... and then 998 (499/500), 002 (1/334), 997 (333/334), 249 (3/253), 667 (4/253), 003 (1/251), 498 (1/251), 501 (1/251), 749 (1/251), 332 (83/250), 996 (249/250), 799 (163/204), 334 (1/203), 399 (1/203), 599 (121/202), 199 (1/201), 004 (1/201), 665 (133/200), 995 (199/200). The last few interesting ones where the substring doesn't occur immediately after the decimal point are 499 as given above, and 249: 3/253 = .0118577075098814229249 667: 4/253 = .01581027667 (501,498,749): 1/251 = .00398406374501992031872509960159362549800796812749 (334,399): 1/203 = .0049261083743842364532019704433497536945812807881773399 Another interesting one: 197: 7/71 = .09859154929577464788732394366197 Complete 2 digit results. The number in parentheses is the number of digits after the decimal point the substring occurs. 00:1/2(2), 01:1/51(1), 02:1/34(1), 03:1/26(1), 04:1/21(1), 05:1/17(1), 06:1/15(1), 07:1/13(1), 08:1/12(1), 09:1/11(1), 10:1/10(1), 11:1/9(1), 12:1/8(1), 13:2/15(1), 14:1/7(1), 15:2/13(1), 16:1/6(1), 17:1/17(12), 18:2/11(1), 19:1/21(5), 20:1/5(1), 21:3/14(1), 22:2/9(1), 23:1/13(5), 24:6/25(1), 25:1/4(1), 26:4/15(1), 27:3/11(1), 28:1/7(3), 29:1/17(8), 30:3/10(1), 31:5/16(1), 32:8/25(1), 33:1/3(1), 34:1/23(3), 35:5/14(1), 36:4/11(1), 37:3/8(1), 38:2/13(3), 39:1/23(19), 40:2/5(1), 41:5/12(1), 42:1/7(2), 43:7/16(1), 44:4/9(1), 45:5/11(1), 46:2/13(5), 47:1/17(15), 48:12/25(1), 49:1/51(15), 50:1/2(1), 51:5/27(3), 52:1/17(7), 53:2/13(2), 54:5/11(2), 55:5/9(1), 56:9/16(1), 57:1/7(5), 58:7/12(1), 59:13/22(1), 60:3/5(1), 61:2/13(6), 62:5/8(1), 63:4/11(2), 64:9/14(1), 65:13/20(1), 66:2/3(1), 67:19/28(1), 68:11/16(1), 69:1/13(3), 70:7/10(1), 71:1/7(6), 72:3/11(2), 73:11/15(1), 74:2/27(2), 75:3/4(1), 76:1/13(2), 77:7/9(1), 78:11/14(1), 79:19/24(1), 80:4/5(1), 81:2/11(2), 82:1/17(4), 83:5/6(1), 84:2/13(4), 85:1/7(4), 86:13/15(1), 87:7/8(1), 88:8/9(1), 89:1/19(9), 90:9/10(1), 91:11/12(1), 92:1/13(4), 93:14/15(1), 94:1/17(9), 95:19/20(1), 96:24/25(1), 97:33/34(1), 98:49/50(1), 99:99/100(1) perl -nwae 'next if /no/;print "",($F[1]-1)*($F[3]-1), " $_"' r2 | sort -n

Saturday, October 02, 2004

Roomba w/ UV lamp

Hi intensity UV lamp on the underside to be germicidal. Unleash it in locker room against athlete foot fungus. -- Mobile Email from a Cingular Wireless Customer http://www.cingular.com

Thursday, September 30, 2004

Baseball team strengths

Assign each team a nonnegative strength value. (For normalization, say, have the sum of strengths be unity or something.) If two teams of strength X and Y play each other, let the probability that X wins be X/(X+Y), and likewise for Y. Find the assignment of strengths with maximum likelihood of explaining the season. An challenging problem is to determine when a team is ``mathematically eliminated'' (under all possible results of future games) from finishing at least n-th in the strength standings.

Sunday, September 26, 2004

Printing

We always try to bind together loose sheets of paper. Can the printer print directly into my spiral notebook?

Sunday, August 22, 2004

asymptotic elliptic integral

I discover that y=ellip(1-t)-1; behaves like 0.25*(-t.*log(t)+t*v) in the neighborhood of t=0, for v=1.77259; where ellip(x)= complete elliptic integral of the second kind. (Later,) v= 4*log(2)-1 from expanding the function around t=1. With one pole out of the way, the function should be a little more amenable to Chebyshev approximation; however, there are still an infinite number of poles at t=1 at higher order.

Ramanujan and Ellipses

Most of Ramanujan's work is not practically useful. However, two exceptions are his formulae for the approximate circumference (perimeter) of an ellipse. Here is the simpler one:

P ~= pi [ 3(a+b) - sqrt((3a+b)(a+3b)) ]

It can be calculated on a standard basic calculator with one register of memory that doesn't obey algebraic operator precedence (times before plus, etc.)

3*a+b=P3*b+a=*RK=QSPa+b=*3=PR*3.141592654=

where P= "M+", R= "MR", K="MC", Q="sqrt", S="+/-". It is a little annoying that a and b need to be typed in 3 times each.

This formula can also be expressed in terms of h=[(a-b)/(a+b)]2, although it's not so helpful for the simple calculator.

P = pi (a+b) [ 3 - sqrt( 4-h ) ]

This formula has 12th order error in eccentricity and worst case relative error of 3.8% (about two decimal digits of precision)

Ramanujan's second formula is more accurate:
P ~= pi (a+b) [ 1 + 3h / ( 10+ sqrt( 4-3h )) ] or on a simple calculator: a+b=Pa-b=/RK*=P*3=S+4=Q+10/3/RK=P1/RK=Pa+b=*R*3.141592654=

This formula has 20th order error in eccentricity and worst case relative error of 0.40% (about 3 decimal digits of precision). David W. Cantrell has added a correction term to Ramanujan's ellipse perimeter formula

                       3h                            12
  pi(a + b) (1 + ----------------- + (4/pi - 14/11) h  ).
                 10 + Sqrt(4 - 3h)

which decreases the worst case error to 0.0014% (about 5 decimal digits of precision). However it no longer seems possible to calculate this formula with only one register of memory.

(What expressions can be calculated with one register of memory?)

Ramanujan came up with his formulae in 1914; Cantrell's correction term is only May 2004. It's interesting that while the circumference of a circle has been laid to rest for thousands of years, improvements in the circumference of an ellipse still continue to this day.

Some matlab code for the Gauss-Kummer series

for i=1:200,n=sym(i),coeff2(i)=(prod((n+1):2*n)/prod(1:n)/((1-2*n)*(-4)^n))^2;end xac2=vpa((1+sum(h.^(1:200).*coeff2))*pi*(a+b),1000)

Cayley series
cay=sym(1)+x/4*(log(16/x)-1);for i=2:100,n=sym(i),cay=cay + x^n * prod(1:2:(2*n-3))^2 * (2*n-1) / (prod(2:2:(2*n-2))^2*(2*n))/2 * (log(16/x)+sum(-4./((1:2:2*n-1) .* (2:2:2*n)))+2/(2*n-1)/(2*n));end

exact value via elliptic integral
[m1,m2]=ellipke(double(1-b*b/a/a)); 4*double(a)*m2

h=(a-b)/(a+b);h=h*h
p3=vpa(pi*(a+b)*(1+3*h/(10+sqrt(4-3*h))),120)
sc=4/sym(pi)-sym(14)/sym(11)
p4=vpa(pi*(a+b)*(1+3*h/(10+sqrt(4-3*h)) + sc*h^12),120)

For Halley's comet, with e=0.9673 and a=17.94AU= 2,683,786,326 km (forget significant digits, and all rounding is by truncation), its perimeter (via 200 terms of Gauss Kummer) is 11,529,383,201.15 km. Ramanujan's first formula underapproximates by 1,175,193.9 km. Second underapproximates by 2637.7 km, and Cantell's correction formula only does slightly better, being under by 2616.4 km.

For a=4, b=3, (a 3-4-5 right triangle), which has 0.66 eccentricity, its perimeter is 22.1034921607095050452855864638724607782782891. Ramanujan's second formula (with or without correction) misses by -1.8e-12 For a=12, b=5 (another right triangle), e=0.9091, perimeter=55.6959493710847386662875219855831134524807, and Ramanujan's second formula (with our without correction) misses by -2.3e-7.

For a=1 b=1/10, e=0.9949 perimeter=4.063974180100895742557793101181576, second formula -4.6e-5, with correction -3.2e-5. For a=1 b=1/100 e=0.99995, perimeter = 4.00109832972265186074746449610774074592667795549222896254442786221, no correction -9.5e-4, with correction -0.49e-4. For a=1 b=1/1000 e=0.9999995, perimeter = 4.00001558810468824461075647365734692443, no correction -15.1e-4, with correction 0.21e-4.

Things for which exact formulae exist: circle perimeter, circle area, ellipse area, ellipsoid area for ellipsoid that have circular cross sections, ellipsoid volume

No exact formulae: ellipse perimeter, general ellipsoid surface area.

Below is a picture of the approximation error of various formulae. Blue is Ramanujan's second formula, green includes Cantrell's correction term, red is Cantrell's 2001 formula involving Hoelder means, cyan is Cantrell's 2004 formula.

ellipse perimeter approximation errors

>> sc=4/pi-14/11;a=1;p=0.825;k=74;p2=0.410117;
>> i=0.1:0.001:10;
>> t=exp(i);b=1./t;xc=ellip(1-b.*b)*4;h=((a-b)./(a+b)).^2;v=pi*(a+b);n=1+3*h./(10+sqrt(4-3*h)); p3=v.*n;p4=v.*(n+sc*h.^12);h2=4*(a+b)-2*(4-pi)*((a+b.^-p)/2).^(1/-p);
>> h3=4*(a+b)-2*(4-pi)*a*b./(p2*(a+b)+(1-2*p2)/(k+1).*sqrt((a+k*b).*(k*a+b)));
>> loglog(t,((xc-p3)./xc),t,(abs(xc-p4)./xc),t,(abs(h2-xc)./xc),t,(abs(h3-xc)./xc))

Saturday, August 21, 2004

Ambidextrously

Ambidextrously (14 letters) might be the longest word in the English language that does not contain any letter more than once.

Isogram

Square roots of negative identity

sqrt(-I) for I=1 is not defined in the reals. However, for I=eye(2), there are solutions. For example [0 1 ; -1 0]2 = [-1 0 ; 0 -1]. The general solution in reals (thanks to Matlab) seems to be [-d, b ; -(1+d2)/b, d]. For 3x3 matrices there appear to be no solutions, so it seems like an odd-even dimensions thing.

Generalizations of complex numbers

Quaternions follow the rule ``i2=j2=k2=ijk=-1'' (which must suck for people who don't know the ordering of the English alphabet). From this we can derive ij=k, jk=i, ki=j, and reversal negates: ji=-k kj=-i ik=-j. from which we can get the squaring rule (a+bi+cj+dk)2 = (a2-b2-c2-d2)+2abi+2acj+2adk Squaring is interesting because z:=z2+c yields fractals. Next idea: complex numbers of complex numbers, where we recursively apply the "square the second component to get the negative of the first component" rule. The normal way to write it out would be with coordinates, but I'll try ijk notation and see what happens: ((a,b),(c,d))2= (a+bi+cj+dk)2= (a2-b2-c2+d2)+(2ab-2cd)i+(2ac-2bd)j+(2bc+2ad)k The multiplication table looks like
    1  i  j  k
  * ----------
1 | 1  i  j  k
i | i -1  k -j
j | j  k -1 -i
k | k -j -i -1
Generalizing complex numbers to 3-vectors of the form (a,(b,c)) runs into the problem of how to define the result of X+(Y,Z) to be a scalar.

Voice interfaces

Speech-recognition interfaces for computers would be good for choosing between many items. I specifically would like to see it for switching betwen applications (MacOS X already sort of does this) and switching between different windows (or buffers, or tabs) within an application. One would need a way to record the name of "this buffer". Perhaps there is something special in its good for changing or choosing among things which don't have a "constant" name. Because if it had a constant name, you could define a shortcut (or bookmark, or hot key, etc.) for it.

Antipodes

On the opposite side of the earth from me is the Indian Ocean, which isn't interesting. Where are the points on land which whose antipode is also on land? What does that set of points look like when plotted on a globe? One can also ask what are the land/water points and the water/water points, though they aren't so interesting.

Wednesday, August 18, 2004

Automatically Figuring Out Acronyms

There ought to be a web service, probably powered by a search engine, that figures out acronyms. For example, if someone wanted to know what, say, MIT stands for, one would look for webpages containing the keywords MIT "M* I* T*", the latter being a wildcarded keyword of three consecutive words starting with the letters M, I, and T. Of course it's harder than that because of small filler words like "of", and other weird ways acronyms and abbreviations are formed.

Slashdot | LOAF - Distributed Social Networking Over Email

Slashdot | LOAF - Distributed Social Networking Over Email Bloom Filters are neat (and I've used a similar them for DNA motif discovery). One could create a bloom filtered image of all substrings of length N in your hard drive, and then send it to a antivirus or anti-adware company for analysis.

Wednesday, August 11, 2004

Factoring Benchmarks

Some fun things to do if you have Pari/GP installed. echo "print(factorint(fibonacci(990)))" | /usr/bin/time gp for(i=1, 100000, print("The factors of (10^50)+", i, " are"); print(factor(10^50+i)," time=", gettime()/60000.0, " minutes")) Feel free to replace 10^50 with 10^60 or 10^70.

Tuesday, August 10, 2004

Common Document Structure Paradigm

Many websites (or documents in general) have the following general structure: (1) Table of Contents (2) Main text referring to: (3) Figures. Instead of being completely general about how content of a page, HTML (or whatever its successor might be) and future browsers ought to be designed to ``do this common case well.'' The simplest version might be: navigation bar across the top; scrollable left column of text with hyperlinks to figures; scrollable right column of figures, which automatically scroll to the right place when a left-column hyperlink is clicked. A few fancy features: Each figure has a "Hide" check box so that an arbitary subset of figures can be compared. Left/Right columns can be swapped to Top/Bottom orientation.

Baseball teams sorted in order

Baseball teams sorted in order by date of mathematical elimination from the playoffs. I wonder if any team has been eliminated yet.

The handheld toy that everyone

The handheld toy that everyone wants: A GPS flashlight cell-phone radio gameboy PDA camera MP3 player remote-control.

Monday, August 09, 2004

Bit compression by a byte compressor

I wonder how well various compression programs, e.g., gzip, bzip2, do on strings that are repetitive at the bit level, but not so obviously repetitive when the bits are packed into bytes. For example consider repeating a 33-bit pattern 32*N times (for a total of of 132*N bytes). A good compressor should asymptotically get a compression factor of 32*N, while a bad one might only get a factor of N (or 8*N?). It's also an interesting problem to prevent repeative occurrence of bytes for this problem. One wants to select a bitstring such that windows of size 8 are all unique.

Sunday, August 08, 2004

Least Primitive Root of Mersenne Primes

Least Primitive Root of Mersenne Primes: All the more reason the C217 composite cofactor of 2^1101+1 ought to be factored. The final terms of the sequence were calculated using the Mersenne factorizations mentioned earlier. The earlier terms were calculated using znprimroot in Pari/GP. Proving a primitive root X of a prime p requires modular exponentiation of X to all powers (p-1)/q where q is a prime factor of (p-1). At first I thought it had to be to all divisors of (p-1), which would have required something like 2^50 work for 2^2281-1; fortunately, it was not.

The least primitive root of M2203 is at least 3, and it probably is 3. 3 is probably the least primitive root for M4253, M9689, M21701, as well. This comes from the observation that 2 never seems to be a primitive root. When 3 is not a primitive root, then 3^((p-1)/3)==1 (mod p) empirically. It's interesting that all mersenne primes except the first seem to have remainder 1 when divided by 3 (true for all odd exponents).

for(i=2, length(p), if((Mod(3,2^p[i]-1)^((2^p[i]-2)/3))!=Mod(1,2^p[i]-1), print(p[i]))) where p is a list of mersenne exponents.

P-1 for some of the higher Mersenne prime exponents are surprisingly smooth: 216090 = 2*3*3*5*7*7*7*7, 20996010 = 2*3*3*3*3*5*7*7*23*23. These would be more interesting targets for the ElevenSmooth project than their number 2*2*2*2*2*2*3*3*3*5*5*7*11 = 3326400

In an unrelated topic, in June I submitted a superseeker query for [7,11,32,40,75,87,136,152,215,235,312,336,427], but I no longer know the significance of the sequence. I think it might have something to do with the Pell Equation. The generating function guesser generated the continuation [455, 560, 592, 711, 747, 880], which I recall the first few terms being correct.

Saturday, August 07, 2004

Capillary Effect

It's interesting how capillary action can make water flow uphill. I wonder if this effect can be harnessed to create an analogue computer for solving tricky optimization problems. Simulated annealing works because uphill steps are allowed, to escape local minima.

Friday, August 06, 2004

A four player card game

Inspired by the paper by Euler, I've come up with a four-player card game. I hereby dub this game "Euler's Coincidence", in honor of the guy who analyzed it. North and East are partners on a team, and likewise South and West (so not like bridge). North gets the clubs, South the spades, East the Hearts, West the Diamonds. On each turn each player places a card on the table and they all simultaneously flip. The game is over if cards of like color match in number. If black cards match, North/East wins 1 point. If red cards match, South/West wins 1 point. On a match, everybody gets their 13 cards back and the game begins anew. Otherwise, the four cards are discarded and play continues. (Note that if (for example) a black 6 and a red 6 appear, then it's not a match.) So therefore, North and West are seeking a match with the player across from them, and South and East are trying to avoid matching. Of course, the optimal play is to play your cards in random order. The game might need to be tweaked still to make people avoid that. Stay tuned for future tweaks.

Monday, August 02, 2004

Negative First Cousin

Cousins (first cousins) share a common grandparent. Second cousins share a common great-grandparent. Third cousins a common great-great-grandparent. Extrapolating the other direction: Zeroth cousins share a common parent and are usually called siblings. Negative first cousins share a common identity: I am my (only) negative first cousin.

Keywords with periods around them

Dear Google, I searched for the keyword 54286614780461303 and got no results. However, the page http://www.mersenneforum.org/showthread.php?t=1544 does contain the keyword. This page is in your archive (I found it by other keywords). The problem seems to be because the keyword is embedded within a string "blah.54286614780461303.blah". My suggestion is that you treat periods as word separators. (You can still also continue to index the longer string with periods embedded.)

A pen with a downward

A pen with a downward pointing light built in to it for writing in the dark.

Wednesday, July 28, 2004

More fun with factorization

Using the tables at the Cunningham Project, one can factor M1279-1, where M1279=2^1279-1 is the 15th Mersenne Prime.

? M1279=2^1279-1;
? isprime(M1279)
%50 = 1
? print(factor((M1279-1)/(a*b*c*d*e*f*z*y*x*w*v)))
[2, 1; 3, 3; 7, 1; 19, 1; 73, 1; 1279, 1; 5113, 1; 17467, 1; 66457, 1; 102241, 1; 228479, 1; 48544121, 1; 56409643, 1; 212885833, 1]

? [a,b,c,d,e,f,v,w,x,y,z]
%51 = [ 28435302301212461494420074814087, 1329628131546931497103420134367, 84462210560148142953097, 4205268574191396793, 2849881972114740679, 581211581673454706767349073071710126567, 4856686864845032704799031665030860909072721381346530375665783654750574941128789505171, 13952598148481, 203525545766301306933226271929, 69779014917427, 8970948423964301024591994817 ]

The large factor (v=48566...171) factors v-1 = 32670537017659 * 30745017857595820376423803727 *372195264810848171907297121582928687 * smaller_factors

No such luck with the next Mersenne prime M2203, where we get stuck with C217 factor of 2^1101+1.

With M2281, we again get pretty lucky to obtain a complete factorization of M2281-1:

2 * 3 * 3 * 5 * 5 * 7 * 11 * 13 * 17 * 31 * 41 * 61 * 151 * 191 * 229 * 241 * 331 * 457 * 571 * 761 * 1217 * 1321 * 2281 * 4561 * 32377 * 54721 * 61681 * 90289 * 131101 * 148961 * 160969 * 174763 * 185821 * 247381 * 524287 * 525313 * 1101811 * 1212847 * 160465489 * 420778751 * 3996146881 * 4562284561 * 9036489073 * 30327152671 * 275415303169 * 24517014940753 * 1457772869697961 * 276696631250953741 * 2416923620660807201 * 3011347479614249131 * 1491477035689218775711 * P23 * 25349242986637720573561 * 29034057164920993379000074993 * P29 * 3435950210316335724157758000789490561 * P38 * P51 * P170

[P23= 23480412082098913326841 ]
[P29= 64326196787727903551977150861 ]
[P38= 15653990705896313547269237220041169361 ]
[P51= 153787279330237476887106331233239525756635010497681 ]
[P170= 51049903050598156013062477654241640657829025002976204451060261008689478158715729745160924860467530309657376827104233308157772350164622158651187694109112727796663977157921 ]

using the automated cunningham factor calculator. Unfortunately P170-1 does not factor easily. It has small factors 2*2*2*2*2*3*5*19*23*41, nontrivial factors 57872616793 and 271819582242082307 and a left over 135 digit composite 377341463808543326355616919094375236137049329420738596924600642749151360224737826546584980131240115699417216932276614698618252847357337.

It is fun to google search some of these numbers to see who else has replicated these results.

Fun with factorization

I'm pleased to report that 253262965868307257488778209946038131361 is a factor to P134-1, where P134 is a prime factor of M757=2^757-1 from NFSNET and is also given below. The desire to factor "prime minus 1" stems from proving primality as well as interesting cycles within the Galois field generated by the prime. The computation took 3.27 days using the MPQS routine in PARI/GP. The final linear algebra step reported by GP is: MPQS: starting Gauss over F_2 on 40260 distinct relations MPQS: Gauss done: kernel has rank 1263, taking gcds... MPQS: splitting N after 70 kernel vectors MPQS: time in Gauss and gcds = 1779770 ms Thus, the complete factorization of P134-1 is 2 * 757 * 31771 * 225975587 * 426665371159 * 2901513458813 * 253262965868307257488778209946038131361 * 7052139211996899091204255207082765933446054813418773253. The product of the last two factors, the 94-digit number 1786045692546521893242296017081938219863268932108739868225086786180708765562719633225087287333, was the hard thing to factor. Note that 757 occurs as a factor, which is not a coincidence. The penultimate factor of M757 is P79, and P79-1 factors without too much trouble: P79-1 = 2 * 2 * 2 * 2 * 13 * 757 * 1229897 * 54286614780461303 * 1380765008073205793 * 394201037959710813849206239443089. Again 757 occurs as a factor. Just to repeat the NFSNET result: 2^757-1 = 9815263 * 561595591 * P79 * P134, where P79 = 5722137022002067824248227975095857749151312827809388406962346253182128916964593 and P134 = 24033821640983508088736273403005965446689002356344332130565066643193813901119771090424269412054543072714914742665677774247325292327559

Sunday, July 25, 2004

They specifically chose a day he wasn't in DC

On September 11th, Al Qaeda chose to keep George Bush in power. On November 2nd, you too can do the same.

Saturday, July 24, 2004

Metric units of time

micromonth=2.6297438second
millihour=3.6second
microyear=31.556926second
milliday=86.4second
milliweek=604.8second
milliday=1.44minute
milliweek=10.08minute
kilosecond=16.666667minute
millimonth=43.829064minute
milliyear=525.94877minute
milliyear=8.7658128hour
kilominute=16.666667hour
megasecond=277.77778hour
megasecond=11.574074day
kilohour=41.666667day
megaminute=694.44444day
megasecond=1.6534392week
kilohour=5.952381week
megaminute=99.206349week
kiloday=142.85714week
kilohour=1.3689546month
megaminute=22.815911month
kiloday=32.854911month
kiloweek=229.98438month
gigasecond=380.26518month
megaminute=1.9013259year
kiloday=2.7379093year
kiloweek=19.165365year
gigasecond=31.688765year
kilomonth=83.333333year
megahour=114.07955year
The weird thing about this table is its order and format. I thought about many different ways of presenting the equivalent information. For example, I could put un-prefixed units along the left column, or I could sort the rows by length of time. Both of these might be more logical. However, the ordering and layout above somehow struck me as paradoxically the most elegant. See also Slow cycle times.

Friday, July 23, 2004

An invented cursive alphabet

This invented cursive alphabet has only four characters, which I will call "i", "r", "l", and "j". The way that they connect to each other is shown below in a four-by-four grid. Note that "rr" and "lr" join in not quite the expected way: there is a cusp instead of a curve before the r. The extra entry at the bottom is "jrj" which has an extra loop to distinguish it from "jj".

Eventually I'll post a Huffman coding of English letter frequencies to map to the English alpabet to this script alphabet.

Thursday, July 22, 2004

Document ReFindingKey

For every webpage one creates, also include within it (perhaps in a font the same color as the background) the string like "Document ReFindingKey vturoagj". Also include the ReFindingKey vturoagj in the file name of the webpage (or for index.html, the name of the enclosing directory). If the webpage moves, and all the links to it die, the page can re-found (hence re-finding-key) again by web searching for vturoagj. And people know the ReFindingKey because they know the file name of the old (dead) link.

I'd recommend 8 random characters of 'a' through 'z', enough for 200 billion unique keys. Collisions are not a problem because there is presumably a human in the loop who can distinguish among the collisions.

Update: search UUID

Random string generator

Tuesday, July 13, 2004

Pitchers' Home Run Derby

Tejada towers at Derby: "Berkman proposed a pitchers' Home Run Derby would be way more entertaining -- because 'all they do in BP is try to hit home runs, anyway.'"

Friday, July 09, 2004

Baseball blasphemies

What changes would I like to see to baseball?
  • Trade Nomar to the Giants, for the good of the game. Nomar is great, and I'd love to see him continue to play for Boston, but there's someone who needs him more: Barry Bonds. The world wants to see Bonds hit, and all his intentional walks are denying the world that privilege. The Giants need a high batting average slugging threat behind Bonds in the line-up, so that opposing teams will pitch to Bonds more. To maintain parity, the Yankees should send Alex Rodriguez over, too. Maybe the Giants can give us Jason Schmidt back in exchange.
  • Eliminate the home run. (Yeah, I know these blasphemies are incompatible with each other.) With the horrid specter of steroid use hanging over the game, we can lesson the effect of steriods by not rewarding power hitting. Any ball that goes over the far fence is just like any other fence: foul.
  • Replace the pitcher with a pitching machine. The outcome of the game depends too heavily on the pitcher's performance. All that repetitive motion gets them injured in sad ways. Replace him with a pitching machine that always throws strikes. The strategic component is choosing the right pitch on every occasion. Put a cap of (say) 85 mph on the pitch, but allow curves of every possible axis, angle, orientation, and rate of rotation. Where the seams are relative to the axis of rotation matters.
  • Each league's All-Star lineup should have a defensive squad and an offensive squad. The defensive squad does nothing but field each inning, and the offensive squad does nothing but hit. Of course, a player may be selected to play on both defensive and offensive squads (e.g., Ichiro). Offense matters much more than good fielding, so too often we see sloppy defense in the All-Star game. We all like to see web gems, too.
  • Open a franchise in Havana.

Monday, July 05, 2004

Boston Chowderfest 2004

Clam chowder and artificial lemonade do not go well together: Some weird reaction in the mouth causes the lemonade to taste awful. Also, food coma set in after a medium-sized quantity, probably caused by the large quantity of milk or cream.

Sunday, July 04, 2004

Polygonal Moser's worm decision problem

Given a worm defined by connected line segments, and a blanket defined by a polygon, can the blanket be rotated, shifted, and flipped to cover the worm?

Three cuts, seven equal pieces

By extending the edges of a triangle, one can cut a cake into seven pieces. Is there a convex shape that can be cut into 7 equal-area pieces by 3 cuts? Failing that, of all shapes which can be cut into 7 equal-area pieces by 3 cuts, which has the minimum perimeter? Does the answer change if we prohibit holes? The answer will probably have a pleasing 3-pointed boomerang shape. Is it possible to cut a (possibly concave) shape into 7 equal-area pieces by 3 cuts so that the resulting pieces are all convex? (Pretty easily yes.) What if we require every cut to be of the form "air-cake-air"? That is, the knife encounters only a single segment of cake along the infinite length cut.

Saturday, July 03, 2004

Grammar checking by markov chaining

Start with a reasonably good Markov model of English, say, 1st-order. Also append to it the bigram counts of the text to be grammar checked. This eliminates zero probabilities of non-existent bigrams in the training set. Finally, highlight the bigrams in the text which are low probability, perhaps ranked by probability. Mumble mumble some sort of normalization, conditioning, etc., mumble mumble. The most frequent grammar errors I make are those caused by cut-and-paste, or losing my train of thought while typing. These result in "easy" grammar errors: sentences that make no sense at all. Consequently, these errors can be caught by a relatively simple model of the language.

Things wrong with xcalc

  • Button text doesn't scale as the window is scaled
  • AC clears memeory
  • No visual feedback when keyboard shortcuts are used (especially for operators)
  • Buttons should be square
  • Buttons should re-array themselves to stay squarish
  • When window is large, a large amount of the left side of the output display is unused
  • ability to FLIP the arguments to minus, divide, and power.
  • Backspace
  • 5 + = = = = = should print out multiples of 5
  • A few more extra functions, like erf, binomial
  • reverse polish notation
  • Scroll back of the calculation (view stack)
  • cut and paste buttons
  • Sound feedback