Phascinating Phibonacci Phact Phor Phiday

Phiday falls on the 11th, 12th and 23rd of each month, because 11, 12 and 23 represent entries in the famous Fibonacci sequence:

1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811, 514229, 832040, 1346269, 2178309, 3524578, 5702887, 9227465, 14930352, 24157817, 39088169, 63245986, 102334155, 165580141, 267914296, 433494437, 701408733, 1134903170, 1836311903, 2971215073, 4807526976, 7778742049, 12586269025, 20365011074, 32951280099, 53316291173, 86267571272, 139583862445, 225851433717, 365435296162, 591286729879, 956722026041, 1548008755920, 2504730781961, 4052739537881, 6557470319842, 10610209857723, 17167680177565, 27777890035288, 44945570212853, 72723460248141, 117669030460994, 190392490709135, 308061521170129, 498454011879264, 806515533049393, 1304969544928657, …

Successive entries in the Fibonacci sequence provide better and better approximations to the golden ratio or φ = 1.61803398874989484820458683…

2 = 2/1
1.5 = 3/2
1.6 = 5/3
1.6 = 8/5
1.625 = 13/8
1.6153846… = 21/13
1.619047619… = 34/21
1.6176470588235294117647… = 55/34
1.618… = 89/55
1.617977528… = 144/89
1.61805… = 233/144
1.618025751… = 377/233
1.618037135… = 610/377
1.618032786… = 987/610
1.618034447… = 1597/987
1.618033813… = 2584/1597
1.618034055… = 4181/2584
1.618033963… = 6765/4181
1.618033998… = 10946/6765
1.618033985… = 17711/10946

Today is 23rd June, so here’s a Fascinating Fibonacci Fact for Phiday. First, list the rational fractions < 1 in simplified form and mark the Fibonacci fractions:

1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 2/5, 3/5, 4/5, 1/6, 5/6, 1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 1/8, 3/8, 5/8, 7/8, 1/9, 2/9, 4/9, 5/9, 7/9, 8/9, 1/10, 3/10, 7/10, 9/10, 1/11, 2/11, 3/11, 4/11, 5/11, 6/11, 7/11, 8/11, 9/11, 10/11, 1/12, 5/12, 7/12, 11/12, 1/13, 2/13, 3/13, 4/13, 5/13, 6/13, 7/13, 8/13, 9/13, 10/13, 11/13, 12/13, 1/14, 3/14, 5/14, 9/14, 11/14, 13/14, 1/15, 2/15, 4/15, 7/15, 8/15, 11/15, 13/15, 14/15, 1/16, 3/16, 5/16, 7/16, 9/16, 11/16, 13/16, 15/16, 1/17, 2/17, 3/17, 4/17, 5/17, 6/17, 7/17, 8/17, 9/17, 10/17, 11/17, 12/17, 13/17, 14/17, 15/17, 16/17, 1/18, 5/18, 7/18, 11/18, 13/18, 17/18, 1/19, 2/19, 3/19, 4/19, 5/19, 6/19, 7/19, 8/19, 9/19, 10/19, 11/19, 12/19, 13/19, 14/19, 15/19, 16/19, 17/19, 18/19, 1/20, 3/20, 7/20, 9/20, 11/20, 13/20, 17/20, 19/20, 1/21, 2/21, 4/21, 5/21, 8/21, 10/21, 11/21, 13/21, 16/21, 17/21, 19/21, 20/21, 1/22, 3/22, 5/22, 7/22, 9/22, 13/22, 15/22, 17/22, 19/22, 21/22, 1/23, 2/23, 3/23, 4/23, 5/23, 6/23, 7/23, 8/23, 9/23, 10/23, 11/23, 12/23, 13/23, 14/23, 15/23, 16/23, 17/23, 18/23, 19/23, 20/23, 21/23, 22/23…

Next, record the positions in the fraction list of the FibFracs, i.e. pos(fibonacci(i)/fibonacci(i+1)) = pos(fibfrac(i)):

1, 3, 8, 20, 53, 135, 353, 924, 2422, 6311, 16529, 43229, 113066, 296173, 775286, 2029661, 5313844, 13911391, 36419909, 95348490, 249624578, 653521015, 1710943906, 4479312193, 11726939926, 30701521655, 80377560978, 210431191133, 550915866198, 1442316294349, 3776032465954, 9885782372588, 25881314454327, 67758160822605, 177393168080718, 464421339906882, 1215870841639593, …

What do you get when you divide pos(fibfrac(i+1)) by pos(fibfrac(i))?

pos(1/2) = 1
pos(2/3) = 3 (3/1 = 3)
pos(3/5) = 8 (8/3 = 2.6…)
pos(5/8) = 20 (20/8 = 2.5)
pos(8/13) = 53 (53/20 = 2.65)
pos(13/21) = 135 (2.5471698113207…)
pos(21/34) = 353 (2.6148…)
pos(34/55) = 924 (2.617563739376770538243626062…)
pos(55/89) = 2422 (2.621…)
pos(89/144) = 6311 (2.605697770437654830718414533…)
pos(144/233) = 16529 (2.619077800665504674378070037…)
pos(233/377) = 43229 (2.615342730957710690301893642…)
pos(377/610) = 113066 (2.615512734506928219482291980…)
pos(610/987) = 296173 (2.619470044045071020465922559…)
pos(987/1597) = 775286 (2.617679531895209894217231145…)
pos(1597/2584) = 2029661 (2.617951310871084993150914630…)
pos(2584/4181) = 5313844 (2.618094351716863062353762525…)
pos(4181/6765) = 13911391 (2.617952465296309037299551888…)
pos(6765/10946) = 36419909 (2.617991903182075753603647543…)
pos(10946/17711) = 95348490 (2.618032076906068051954770123…)
pos(17711/28657) = 249624578 (2.618023400265699016313735016…)
pos(28657/46368) = 653521015 (2.618015502463863954934758067…)
pos(46368/75025) = 1710943906 (2.618039614227248683043497844…)
pos(75025/121393) = 4479312193 (2.618035680358535377956453004…)
pos(121393/196418) = 11726939926 (2.618022459860278821159630657…)
pos(196418/317811) = 30701521655 (2.618033506501651708043379296…)
pos(317811/514229) = 80377560978 (2.618031831816708695313688353…)
pos(514229/832040) = 210431191133 (2.618034045479393794998913484…)
pos(832040/1346269) = 550915866198 (2.618033302153394031845776103…)
pos(1346269/2178309) = 1442316294349 (2.618033683260502304564996035…)
pos(2178309/3524578) = 3776032465954 (2.618033562227999267671331082…)
pos(3524578/5702887) = 9885782372588 (2.618034262608066669117450079…)
pos(5702887/9227465) = 25881314454327 (2.618034008728793003503058474…)
pos(9227465/14930352) = 67758160822605 (2.618033985181798482654668954…)
pos(14930352/24157817) = 177393168080718 (2.618033989221521810752093192…)
pos(24157817/39088169) = 464421339906882 (2.618033969017113072183685603…)
pos(39088169/63245986) = 1215870841639593 (2.618033964338027806153843993…)
[…]

In other words, pos(fibfrac(i+1)) / pos(fibfrac(i)) → φ^2 = 2.61803398874989484820458683… = φ + 1


Previously Pre-Posted (Please Peruse)

Friday is Φiday

Friday is Φiday

The 11th, 12th and 23rd day of a month can be called a φ-day (pronounced fy-day). Why so? Because those numbers are consecutive entries in the famous Fibonacci sequence, which offers better and better approximations to a mathematical constant called φ = (√5 + 1) / 2 = 1.6180339887498948…:

1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, …

Each number after the second is the sum of the preceding two (so 11, 12, 23… could be the start of a similar sequence). When you divide fib(i) by fib(i-1), you get these approximations to φ:

2 = 2/1
1.5 = 3/2
1.6 = 5/3
1.6 = 8/5
1.625 = 13/8
1.6153846… = 21/13
1.619047619… = 34/21
1.6176470588235294117647… = 55/34
1.618… = 89/55
1.617977528… = 144/89
1.61805… = 233/144
1.618025751… = 377/233
1.618037135… = 610/377
1.618032786… = 987/610
1.618034447… = 1597/987
1.618033813… = 2584/1597
1.618034055… = 4181/2584
1.618033963… = 6765/4181
1.618033998… = 10946/6765
1.618033985… = 17711/10946

Today is the 23rd and not just a φ-day but a Friday (or φriday). So here’s one of the interesting results I’ve recently found while playing with the Fibonacci sequence. As any recreational mathematician kno, you can also find the Fibonacci sequence — and φ — with this little algorithm:

f = 0
LOOP
f = 1 / (f + 1)
print(f)
goto LOOP

The algorithm returns these values:

1, 1/2, 2/3, 3/5, 5/8, 8/13, 13/21, 21/34, 34/55, 55/89, 89/144, 144/233, 233/377, 377/610, 610/987, 987/1597, 1597/2584, 2584/4181, 4181/6765, 6765/10946, 10946/17711, …

I was playing with that algorithm and got an unexpected result with a simple adaptation of it:

f = 0
LOOP
f = 1 / (3 – f)
print(f)
goto LOOP

The values of f generated by this adapted algorithm are:

1/3, 3/8, 8/21, 21/55, 55/144, 144/377, 377/987, 987/2584, 2584/6765, 6765/17711, 17711/46368, 46368/121393, 121393/317811, 317811/832040, 832040/2178309, 2178309/5702887, 5702887/14930352, 14930352/39088169, 39088169/102334155, 102334155/267914296, …

The numerator and denominator in each fraction are next-but-one Fibonacci numbers, beautifully generated at each step:

3 – 0 = 3 → 1/3
3 – 1/3 = (3*3)/3 – 1/3 = 9/3 – 1/3 = (9-1) / 3 = 8 / 3 → 1/(8/3) = 3/8
3 – 3/8 = (3*8)/3 – 3/8 = 24/8 – 3/8 = (24-3) / 8 = 21/8 → 1/(21/8) = 8/21
3 – 8/21 = (3*21)/21 – 8/21 = 63/21 – 8/21 = (63-8)/21 = 55/21 → 1/(55/21) = 21/55
3 – 21/55 = (3*55)/55 – 21/55 = 165/55 – 21/55 = (165-21)/55 = 144/55 → 1/(144/55) = 55/144
3 – 55/144 = (3*144)/144 – 55/144 = (432-55)/144 = 377/144 → 1/(377/144) = 144/377
3 – 144/377 = (3*377)/377 – 144/377 = (1131-144)/377 = 987/377 → 1/(987/377) = 377/987
[…]

If you reverse numerator and denominator, the limit of the fraction is φ^2 = 2.6180339887498948… = φ+1:

3 = 3/1
2.6 = 8/3
2.625 = 21/8
2.6190476190476190476190476… = 55/21
2.6181818181818181818181818… = 144/55
2.6180555555555555555555555… = 377/144
2.6180371352785145888594164… = 987/377
2.6180344478216818642350557… = 2584/987
2.6180340557275541795665634… = 6765/2584
2.6180339985218033998521803… = 17711/6765
2.6180339901755970865563773… = 46368/17711
2.6180339889579020013802622… = 121393/46368
2.6180339887802426828565073… = 317811/121393
2.6180339887543225376088304… = 832040/317811
2.6180339887505408393827219… = 2178309/832040
2.6180339887499890970472967… = 5702887/2178309
2.6180339887499085989254214… = 14930352/5702887
2.6180339887498968544077192… = 39088169/14930352
2.6180339887498951409056791… = 102334155/39088169
2.6180339887498948909091006… = 267914296/102334155

The Call of CFulhu

“The most merciful thing in the world, I think, is the inability of the human mind to correlate all its contents.” So said HPL in “The Call of Cthulhu” (1926). But I’d still like to correlate the contents of mine a bit better. For example, I knew that φ, the golden ratio, is the most irrational of all numbers, in that it is the slowest to be approximated with rational fractions. And I also knew that continued fractions, or CFs, were a way of representing both rationals and irrationals as a string of numbers, like this:

contfrac(10/7) = [1; 2, 3]
10/7 = 1 + 1/(2 + 1/3)
10/7 = 1.428571428571…

contfrac(3/5) = [0; 1, 1, 2]
4/5 = 0 + 1/(1 + 1/(1 + 1/2))
4/5 = 0.8

contfrac(11/8) = [1; 2, 1, 2]
11/8 = 1 + 1/(2 + 1/(1 + 1/2))
11/8 = 1.375

contfrac(4/7) = [0; 1, 1, 3]
4/7 = 0 + 1/(1 + 1/(1 + 1/3))
4/7 = 0.57142857142…

contfrac(17/19) = [0; 1, 8, 2]
17/19 = 0 + 1/(1 + 1/(8 + 1/2))
17/19 = 0.8947368421052…

contfrac(8/25) = [0; 3, 8]
8/25 = 0 + 1/(3 + 1/8)
8/25 = 0.32

contfrac(√2) = [1; 2, 2, 2, 2, 2, 2, 2…] = [1; 2]

√2 = 1 + 1/(2 + 1/(2 + 1/(2 + 1/(2 + 1/(2 + 1/(2 + 1/2 + …))))))

√2 = 1.41421356237309504…

contfrac(φ) = [1; 1, 1, 1, 1, 1, 1, 1, 1…]

φ = 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/1 + …)))))))

φ = 1.6180339887498948…


But I didn’t correlate those two contents of my mind: the maximal irrationality of φ and the way continued fractions work.

That’s why I was surprised when I was looking at the continued fractions of 2..(n-1) / n for 3,4,5,6,7… That is, I was looking at the continued fractions of 2/3, 3/4, 2/5, 3/5, 4/5, 5/6, 2/7, 3/7… (skipping fractions like 2/4, 2/6, 3/6 etc, because they’re reducible: 2/4 = ½, 2/6 = 1/3, 3/6 = ½ etc). I wondered which fractions set successive records for the length of their continued fractions as one worked through ½, 2/3, 3/4, 2/5, 3/5, 4/5, 5/6, 2/7, 3/7… And because I hadn’t correlated the contents of my mind, I was surprised at the result. I shouldn’t have been, of course:

contfrac(1/2) = [0; 2] (cfl=1)
1/2 = 0 + 1/2
1/2 = 0.5

contfrac(2/3) = [0; 1, 2] (cfl=2)
2/3 = 0 + 1/(1 + 1/2)
2/3 = 0.666666666…

contfrac(3/5) = [0; 1, 1, 2] (cfl=3)
3/5 = 0 + 1/(1 + 1/(1 + 1/2))
3/5 = 0.6

contfrac(5/8) = [0; 1, 1, 1, 2] (cfl=4)
5/8 = 0 + 1/(1 + 1/(1 + 1/(1 + 1/2)))
5/8 = 0.625

contfrac(8/13) = [0; 1, 1, 1, 1, 2] (cfl=5)
8/13 = 0 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/2))))
8/13 = 0.615384615…

contfrac(13/21) = [0; 1, 1, 1, 1, 1, 2] (cfl=6)
13/21 = 0 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/2)))))
13/21 = 0.619047619…

contfrac(21/34) = [0; 1, 1, 1, 1, 1, 1, 2] (cfl=7)
21/34 = 0 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/2))))))
21/34 = 0.617647059…

contfrac(34/55) = [0; 1, 1, 1, 1, 1, 1, 1, 2] (cfl=8)
contfrac(55/89) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=9)
contfrac(89/144) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=10)
contfrac(144/233) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=11)
contfrac(233/377) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=12)
contfrac(377/610) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=13)
contfrac(610/987) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=14)
contfrac(987/1597) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=15)
contfrac(1597/2584) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=16)
contfrac(2584/4181) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=17)
contfrac(4181/6765) = [0; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=18)
[…]


Which n1/n2 set records for the length of their continued fractions (with n2 > n1)? It’s the successive Fibonacci fractions, fib(i)/fib(i+1), of course. I didn’t anticipate that answer because I didn’t understand φ and continued fractions properly. And I still don’t, because I’ve been surprised again today looking at palindromic CFs like these:

contfrac(2/5) = [0; 2, 2] (cfl=2)
2/5 = 0 + 1/(2 + 1/2)
2/5 = 0.4

contfrac(3/8) = [0; 2, 1, 2] (cfl=3)
3/8 = 0 + 1/(2 + 1/(1 + 1/2))
3/8 = 0.375

contfrac(3/10) = [0; 3, 3] (cfl=2)
3/10 = 0 + 1/(3 + 1/3)
3/10 = 0.3

contfrac(5/12) = [0; 2, 2, 2] (cfl=3)
5/12 = 0 + 1/(2 + 1/(2 + 1/2))
5/12 = 0.416666666…

contfrac(5/13) = [0; 2, 1, 1, 2] (cfl=4)
5/13 = 0 + 1/(2 + 1/(1 + 1/(1 + 1/2)))
5/13 = 0.384615384…

contfrac(4/15) = [0; 3, 1, 3] (cfl=3)
4/15 = 0 + 1/(3 + 1/(1 + 1/3))
4/15 = 0.266666666…

contfrac(7/16) = [0; 2, 3, 2] (cfl=3)
7/16 = 0 + 1/(2 + 1/(3 + 1/2))
7/16 = 0.4375

contfrac(4/17) = [0; 4, 4] (cfl=2)
4/17 = 0 + 1/(4 + 1/4)
4/17 = 0.235294117…


Again, I wondered which of these fractions set successive records for the length of their palindromic continued fractions. Here’s the answer:

contfrac(1/2) = [0; 2] (cfl=1)
1/2 = 0 + 1/2
1/2 = 0.5

contfrac(2/5) = [0; 2, 2] (cfl=2)
2/5 = 0 + 1/(2 + 1/2)
2/5 = 0.4

contfrac(3/8) = [0; 2, 1, 2] (cfl=3)
3/8 = 0 + 1/(2 + 1/(1 + 1/2))
3/8 = 0.375

contfrac(5/13) = [0; 2, 1, 1, 2] (cfl=4)
5/13 = 0 + 1/(2 + 1/(1 + 1/(1 + 1/2)))
5/13 = 0.384615384…

contfrac(8/21) = [0; 2, 1, 1, 1, 2] (cfl=5)
8/21 = 0 + 1/(2 + 1/(1 + 1/(1 + 1/(1 + 1/2))))
8/21 = 0.380952380…

contfrac(13/34) = [0; 2, 1, 1, 1, 1, 2] (cfl=6)
13/34 = 0 + 1/(2 + 1/(1 + 1/(1 + 1/(
1
+ 1/(1 + 1/2)))))
13/34 = 0.382352941..

contfrac(21/55) = [0; 2, 1, 1, 1, 1, 1, 2] (cfl=7)
21/55 = 0 + 1/(2 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/2))))))
21/55 = 0.381818181…

contfrac(34/89) = [0; 2, 1, 1, 1, 1, 1, 1, 2] (cfl=8)
contfrac(55/144) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=9)
contfrac(89/233) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=10)
contfrac(144/377) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=11)
contfrac(233/610) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=12)
contfrac(377/987) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=13)
contfrac(610/1597) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=14)
contfrac(987/2584) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=15)
contfrac(1597/4181) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=16)
contfrac(2584/6765) = [0; 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (cfl=17)
[…]


Now it’s the successive Fibonacci skip-one fractions, fib(i)/fib(i+2), that set records for the length of their palindromic continued fractions. But I think you’d have to be very good at maths not to be surprised by that result.

After that, I continued to be compelled by the Call of CFulhu and started to look at the CFs of Fibonacci skip-n fractions in general. That’s contfrac(fib(i)/fib(i+n)) for n = 1,2,3,… And I’ve found more interesting patterns, as I’ll describe in a follow-up post.

Message from Mater

As any recreational mathematician kno, the Ulam spiral shows the prime numbers on a spiral grid of integers. Here’s a Ulam spiral with 1 represented in blue and 2, 3, 5, 7… as white blocks spiralling anti-clockwise from the right of 1:

The Ulam spiral of prime numbers


Ulam spiral at higher resolution


I like the Ulam spiral and whenever I’m looking at new number sequences I like to Ulamize it, that is, display it on a spiral grid of integers. Sometimes the result looks good, sometimes it doesn’t. But I’ve always wondered something beforehand: will this be the spiral where I see a message appear? That is, will I see a message from Mater Mathematica, Mother Maths, the omniregnant goddess of mathematics? Is there an image or text embedded in some obscure number sequence, revealed when the sequence is Ulamized and proving that there’s divine intelligence and design behind the universe? Maybe the image of a pantocratic cat will appear. Or a text in Latin or Sanskrit or some other suitably century-sanctified language.

That’s what I wonder. I don’t wonder it seriously, of course, but I do wonder it. But until 22nd March 2025 I’d never seen any Ulam-ish spiral that looked remotely like a message. But 22nd May is the day I Ulamed some continued fractions. And I saw something that did look a little like a message. Like text, that is. But I might need to explain continued fractions first. What are they? They’re a fascinating and beautiful way of representing both rational and irrational numbers. The continued fractions for rational numbers look like this in expanded and compact format:

5/3 = 1 + 1/(1 + ½) = 1 + ⅔
5/3 = [1; 1, 2]

19/7 = 2 + 1/(1 + 1/(2 + ½)) = 2 + 4/7
19/7 = [2; 1, 2, 2]

2/3 = 0 + 1/(1 + 1/2)
2/3 = [0; 1, 2] (compare 5/3 above)

3/5 = 0 + 1/(1 + 1/(1 + 1/2))
3/5 = [0; 1, 1, 2]

5/7 = 0 + 1/(1 + 1/(2 + 1/2))
5/7 = [0; 1, 2, 2] (compare 19/7 above)

13/17 = 0 + 1/(1 + 1/(3 + 1/4))
13/17 = [0; 1, 3, 4]

30/67 = 0 + 1/(2 + 1/(4 + 1/(3 + ½)))
30/67 = [0; 2, 4, 3, 2]

The continued fractions of irrational numbers are different. Most importantly, they never end. For example, here are the infinite continued fractions for φ, √2 and π in expanded and compact format:

φ = 1 + (1/(1 + 1/(1 + 1/(1 + …)))φ = [1; 1]

√2 = 1 + (1/(2 + 1/(2 + 1/(2 + …)))
√2 = [1; 2]

π = 3 + 1/(7 + 1/(15 + 1/(1 + 1/(292 + 1/(1 + 1/(1 + 1/(1 + 1/(2 + 1/(1 + 1/(3 +…))))))))))
π = [3; 7, 15, 1, 292, 1, 1, 1, 2, 1, 3…]

As you can see, the continued fraction of π doesn’t fall into a predictable pattern like those for φ and √2. But I’ve already gone into continued fractions further than I need for this post, so let’s return to the continued fractions of rationals. I set up an Ulam spiral to show patterns based on the continued fractions for 1/1, ½, ⅓, ⅔, 1/4, 2/4, 3/4, 1/5, 2/5, 3/5, 4/5, 1/6, 2/6, 3/6… (where the fractions are assigned to 1,2,3… and 2/4 = ½, 2/6 = ⅓ etc). For example, if the continued fraction contains a number higher than 5, you get this spiral:

Spiral for continued fractions containing at least number > 5


With tests for higher and higher numbers in the continued fractions, the spirals start to thin and apparent symbols start to appear in the arms of the spirals:

Spiral for contfrac > 10


Spiral for contfrac > 15


Spiral for contfrac > 20


Spiral for contfrac > 25


Spiral for contfrac > 30


Spiral for contfrac > 35


Spiral for contfrac > 40


Spirals for contfrac > 5..40 (animated at EZgif)


Here are some more of these spirals at increasing magnification:

Spiral for contfrac > 23 (#1)


Spiral for contfrac > 23 (#2)


Spiral for contfrac > 23 (#3)


Spiral for contfrac > 13


Spiral for contfrac > 15 (off-center)


Spiral for contfrac > 23 (off-center)


And here are some of the symbols picked out in blue:

Spiral for contfrac > 15 (blue symbols)


Spiral for contfrac > 23 (blue symbols)


But they’re not really symbols, of course. They’re quasi-symbols, artefacts of the Ulamization of a simple test on continued fractions. Still, they’re the closest I’ve got so far to a message from Mater Mathematica.

Polykoch!

This is how you form the famous Koch snowflake, in which at each stage you erect a new triangle on the middle of each line whose sides are 1/3 the length of the line:

Koch snowflake #1


Koch snowflake #2


Koch snowflake #3


Koch snowflake #4


Koch snowflake #5


Koch snowflake #6


Koch snowflake #7


Koch snowflake (animated)


Here’s a variant of the Koch snowflake, with new mid-triangles whose sides are 1/2 the length of the lines:

Koch snowflake (1/2 side) #1


Koch snowflake (1/2 side) #2


Stage #3


Stage #4


Stage #5


Stage #6


Stage #7


Stage #8


Koch snowflake (1/2 side) (animated)


But why stop at triangles? This is a Koch square, in which at each stage you erect a new 1/3 square on the middle of each line:

Koch square #1


Koch square #2


Koch square #3


Koch square #4


Koch square #5


Koch square #6


Koch square (animated)


And a Koch pentagon, in which at each stage you erect a pentagon on the middle of each line whose sides are 1 – (1/φ^2 * 2) = 0·236067977… the length of the line (I used 55/144 as an approximation of 1/φ^2):

Koch pentagon (side 55/144) #1


Koch pentagon #2


Koch pentagon #3


Koch pentagon #4


Koch pentagon #5


Koch pentagon #6


Koch pentagon (animated)


In this close-up, you can see how precisely the sprouting pentagons kiss at each stage:

Koch pentagon (close-up) #1


Koch pentagon (close-up) #2


Koch pentagon (close-up) #3


Koch pentagon (close-up) #4


Koch pentagon (close-up) #5


Koch pentagon (close-up) #6


Koch pentagon (close-up) (animated)


Sphiral Architect

If you’re a fan of Black Sabbath, you may have misread the title of this blog-post. But it’s not “Spiral Architect”, it’s “Sphiral Architect”. And this is a sphiral:

A sphiral
(the red square is the center)


But why do I call it a sphiral? The answer starts with the Fibonacci sequence, which is at once a perfectly simple and profoundly complex sequence of numbers. It’s very easy to create, yet yields endless riches. Simply seed the sequence with 1s, then add the previous two numbers in the sequence to get the next:


1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811, 514229, 832040, 1346269, 2178309, 3524578, 5702887, 9227465, 14930352, 24157817, 39088169, 63245986, 102334155, 165580141, 267914296, 433494437, 701408733, 1134903170, 1836311903, 2971215073, 4807526976, 7778742049, 12586269025...


Each pair of numbers provides a better and better approximation to phi or φ, an irrational number whose decimal digits never end and never fall into a repeating pattern. It satisfies the equations 1/x = x-1 and x^2 = x+1:


1.6180339887498948482045868343656381177203091798... = φ

1 / 1.6180339887498948482045868343656381177203091798... = 0.6180339887498948482045868343656381177203091798...

1.6180339887498948482045868343656381177203091798...^2 = 2.6180339887498948482045868343656381177203091798...


Here are the approximations to φ supplied by successive pairs of numbers in the Fibonacci sequence:


1 = 1/1
2 = 2/1
1.5 = 3/2
1.666... = 5/3
1.6 = 8/5
1.625 = 13/8
1.6153846153846... = 21/13
1.619047619047619047619047... = 34/21
1.6176470588235294117647... = 55/34
1.6181818... = 89/55
1.617977528... = 144/89
1.6180555... = 233/144
1.618025751... = 377/233
1.6180371352785... = 610/377
1.6180327868852459... = 987/610
1.618034447821681864235... = 1597/987
1.6180338134... = 2584/1597
1.61803405572755... = 4181/2584
1.6180339631667... = 6765/4181
1.6180339985218... = 10946/6765
1.618033985... = 17711/10946
1.61803399... = 28657/17711
1.6180339882... = 46368/28657
1.6180339889579... = 75025/46368
1.61803398867... = 121393/75025
1.61803398878... = 196418/121393
1.6180339887383... = 317811/196418
1.6180339887543225376... = 514229/317811
1.6180339887482... = 832040/514229
1.61803398875... = 1346269/832040
1.6180339887496481... = 2178309/1346269
1.618033988749989... = 3524578/2178309
1.61803398874985884835... = 5702887/3524578
1.6180339887499... = 9227465/5702887
1.6180339887498895958965978... = 14930352/9227465
1.6180339887498968544... = 24157817/14930352
1.618033988749894... = 39088169/24157817
1.61803398874989514... = 63245986/39088169
1.6180339887498947364... = 102334155/63245986
1.61803398874989489... = 165580141/102334155
1.618033988749894831892914... = 267914296/165580141
1.618033988749894854435... = 433494437/267914296
1.618033988749894845824745843278261031063704284629608753202985163 = 701408733/433494437
1.6180339887498948491136... = 1134903170/701408733
1.618033988749894847857... = 1836311903/1134903170
1.61803398874989484833721... = 2971215073/1836311903
1.6180339887498948481... = 4807526976/2971215073
1.61803398874989484822... = 7778742049/4807526976
1.618033988749894848197... = 12586269025/7778742049
1.6180339887498948482... = 20365011074/12586269025
1.6180339887498948482045868343656381177203091798... = φ


I decided to look at how integers could be the partial sums of unique Fibonacci numbers. For example:


Using 1, 2, 3, 5, 8, 13, 21, 34, 55, 89...

1 = 1
2 = 2
3 = 1+2 = 3
4 = 1+3
5 = 2+3 = 5
6 = 1+2+3 = 1+5
7 = 2+5
8 = 1+2+5 = 3+5 = 8
9 = 1+3+5 = 1+8
10 = 2+3+5 = 2+8
11 = 1+2+3+5 = 1+2+8 = 3+8
12 = 1+3+8
13 = 2+3+8 = 5+8 = 13
14 = 1+2+3+8 = 1+5+8 = 1+13
15 = 2+5+8 = 2+13
16 = 1+2+5+8 = 3+5+8 = 1+2+13 = 3+13
17 = 1+3+5+8 = 1+3+13
18 = 2+3+5+8 = 2+3+13 = 5+13
19 = 1+2+3+5+8 = 1+2+3+13 = 1+5+13
20 = 2+5+13
21 = 1+2+5+13 = 3+5+13 = 8+13 = 21
22 = 1+3+5+13 = 1+8+13 = 1+21
23 = 2+3+5+13 = 2+8+13 = 2+21
24 = 1+2+3+5+13 = 1+2+8+13 = 3+8+13 = 1+2+21 = 3+21
25 = 1+3+8+13 = 1+3+21
26 = 2+3+8+13 = 5+8+13 = 2+3+21 = 5+21
27 = 1+2+3+8+13 = 1+5+8+13 = 1+2+3+21 = 1+5+21
28 = 2+5+8+13 = 2+5+21
29 = 1+2+5+8+13 = 3+5+8+13 = 1+2+5+21 = 3+5+21 = 8+21
30 = 1+3+5+8+13 = 1+3+5+21 = 1+8+21
31 = 2+3+5+8+13 = 2+3+5+21 = 2+8+21


All integers can be represented as partial sums of unique Fibonacci numbers. But what happens when you start removing numbers from the beginning of the Fibonacci sequence, then trying to find partial sums of the integers? Some integers are sumless:


Using 2, 3, 5, 8, 13, 21, 34, 55, 89, 144...

1 has no sum
2 = 2
3 = 3
4 has no sum
5 = 2+3 = 5
6 has no sum
7 = 2+5
8 = 3+5 = 8
9 has no sum
10 = 2+3+5 = 2+8
11 = 3+8
12 has no sum
13 = 2+3+8 = 5+8 = 13
14 has no sum
15 = 2+5+8 = 2+13
16 = 3+5+8 = 3+13
17 has no sum
18 = 2+3+5+8 = 2+3+13 = 5+13
19 has no sum
20 = 2+5+13
21 = 3+5+13 = 8+13 = 21
22 has no sum
23 = 2+3+5+13 = 2+8+13 = 2+21
24 = 3+8+13 = 3+21
25 has no sum
26 = 2+3+8+13 = 5+8+13 = 2+3+21 = 5+21
27 has no sum
28 = 2+5+8+13 = 2+5+21
29 = 3+5+8+13 = 3+5+21 = 8+21
30 has no sum
31 = 2+3+5+8+13 = 2+3+5+21 = 2+8+21


Now try removing more Fibonacci numbers from the sequence:


Using 3, 5, 8, 13, 21, 34, 55, 89, 144, 233...

1 to 2 have no sums
3 = 3
4 has no sum
5 = 5
6 to 7 have no sums
8 = 3+5 = 8
9 to 10 have no sums
11 = 3+8
12 has no sum
13 = 5+8 = 13
14 to 15 have no sums
16 = 3+5+8 = 3+13
17 has no sum
18 = 5+13
19 to 20 have no sums
21 = 3+5+13 = 8+13 = 21
22 to 23 have no sums
24 = 3+8+13 = 3+21
25 has no sum
26 = 5+8+13 = 5+21
27 to 28 have no sums
29 = 3+5+8+13 = 3+5+21 = 8+21
30 to 31 have no sums
32 = 3+8+21


Using 5, 8, 13, 21, 34, 55, 89, 144, 233, 377...

1 to 4 have no sums
5 = 5
6 to 7 have no sums
8 = 8
9 to 12 have no sums
13 = 5+8 = 13
14 to 17 have no sums
18 = 5+13
19 to 20 have no sums
21 = 8+13 = 21
22 to 25 have no sums
26 = 5+8+13 = 5+21
27 to 28 have no sums
29 = 8+21
30 to 33 have no sums
34 = 5+8+21 = 13+21 = 34
35 to 38 have no sums
39 = 5+13+21 = 5+34
40 to 41 have no sums
42 = 8+13+21 = 8+34
43 to 46 have no sums
47 = 5+8+13+21 = 5+8+34 = 13+34
48 to 51 have no sums
52 = 5+13+34


Using 8, 13, 21, 34, 55, 89, 144, 233, 377, 610...

1 to 7 have no sums
8 = 8
9 to 12 have no sums
13 = 13
14 to 20 have no sums
21 = 8+13 = 21
22 to 28 have no sums
29 = 8+21
30 to 33 have no sums
34 = 13+21 = 34
35 to 41 have no sums
42 = 8+13+21 = 8+34
43 to 46 have no sums
47 = 13+34
48 to 54 have no sums
55 = 8+13+34 = 21+34 = 55


Now ask: what fraction of integers can’t be represented as sums as you remove 1,2,3,5… from the Fibonacci sequence? Let’s approach the answer visually and represent the sums on a spiral created in the same way as an Ulam spiral. When the Fib-sums can’t use 1, you get this spiral:

2,3,5-sphiral
(integers that are the partial sums of unique Fibonacci numbers from 2, 3, 5, 8, 13, 21, 34, 55, 89…)

I call it a sphiral, because φ appears in the ratio of white-to-black space in the spiral, as we shall see. Phi also appears in these sphirals:

3,5,8,13-sphiral


5,8,13,21-sphiral


8,13,21,34-sphiral


Sum sphirals from 1,2,3,5 to 8,13,21,34(animated)


How does φ appear in the sphirals? Well, I think it must appear in lots more ways than I’m able to see. But one simple way, as remarked above, is that φ governs the ratio of white-to-black space in each sphiral. When all Fibonacci numbers can be used, there’s no black space, because all integers can be represented as sums of 1, 2, 3, 5, 8, 13, 21, 34, 55, 89… But that changes as numbers are dropped from the beginning of the Fibonacci sequence:


0.6180339887... of integers can be represented as partial sums of 2, 3, 5, 8, 13, 21, 34, 55, 89, 144...
0.6180339887... = 1/φ^1
0.3819660112... of integers can be represented as partial sums of 3, 5, 8, 13, 21, 34, 55, 89, 144, 233...
0.3819660112... = 1/φ^2
0.2360679774... of integers can be represented as partial sums of 5, 8, 13, 21, 34, 55, 89, 144, 233, 377...
0.2360679774... = 1/φ^3
0.1458980337... of integers can be represented as partial sums of 8, 13, 21, 34, 55, 89, 144, 233, 377, 610...
0.1458980337... = 1/φ^4
0.0901699437... of integers can be represented as partial sums of 13, 21, 34, 55, 89, 144, 233, 377, 610, 987...
0.0901699437... = 1/φ^5
0.05572809... of integers can be represented as partial sums of 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597...
0.05572809... = 1/φ^6
0.0344418537... of integers can be represented as partial sums of 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584...
0.0344418537... = 1/φ^7
0.0212862362... of integers can be represented as partial sums of 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181...
0.0212862362... = 1/φ^8
0.0131556174... of integers can be represented as partial sums of 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765...
0.0131556174... = 1/φ^9
0.0081306187... of integers can be represented as partial sums of 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946...
0.0081306187... = 1/φ^10


But why stick to the standard Fibonacci sequence? If you seed a Fibonacci-like sequence with 2s instead of 1s, you get these numbers:


2, 2, 4, 6, 10, 16, 26, 42, 68, 110, 178, 288, 466, 754, 1220, 1974, 3194, 5168, 8362, 13530, 21892, 35422, 57314, 92736, 150050, 242786, 392836, 635622, 1028458, 1664080, 2692538, 4356618, 7049156, 11405774, 18454930, 29860704, 48315634, 78176338, 126491972, 204668310...


Obviously, all numbers in the 2,2,4-sequence are even, so no odd number is the partial sum of unique numbers in the sequence. But all even numbers are partial sums of the sequence. In other words:


0.5 of integers can be represented as partial sums of 2, 2, 4, 6, 10, 16, 26, 42, 68, 110...


So what happens when you drop the 2s and represent the sums graphically? You get this attractive sphiral:

4,6,10,16-sphiral (lo-res)


4,6,10,16-sphiral (hi-res)


In the 4,6,10,16-sphiral, the ratio of white-to-black space is 0.3090169943749474241… This is because:


0.3090169943749474241... of integers can be represented as partial sums of 4, 6, 10, 16, 26, 42, 68, 110, 178, 288...
0.3090169943749474241... = φ^1 * 0.5


Now try the 6,10,16,26-sphiral and 10,16,26,42-sphiral:

6,10,16,26-sphiral


10,16,26,42-sphiral


In the 4,6,10,16-sphiral, the ratio of white-to-black space is 0.190983005625… This is because:


0.190983005625... of integers can be represented as partial sums of 6, 10, 16, 26, 42, 68, 110, 178, 288, 466...
0.190983005625... = φ^2 * 0.5


And so on:


0.1180339887498948482... of integers can be represented as partial sums of 10, 16, 26, 42, 68, 110, 178, 288, 466, 754...
0.1180339887498948482... = φ^3 * 0.5
0.072949016875... of integers can be represented as partial sums of 16, 26, 42, 68, 110, 178, 288, 466, 754, 1220...
0.072949016875... = φ^4 * 0.5


A Walk on the Wide Side

How wide is a number? The obvious answer is to count digits and say that 1 and 9 are one digit wide, 11 and 99 are two digits wide, 111 and 999 are three digits wide, and so on. But that isn’t a very good answer. 111 and 999 are both three digits wide, but 999 is nine larger times than 111. And although 111 and 999 are both one digit wider than 11 and 99, 111 is much closer to 99 than 999 is to 111.

So there’s got to be a better answer to the question. I came across it indirectly, when I started looking at carries in powers. I wanted to know how fast a number grew in digit-width as it was multiplied repeatedly by, say, 2. For example, 2^3 = 8 and 2^4 = 16, so there’s been a carry at the far left and 2^4 = 16 has increased in digit-width by 1 over 2^3 = 8. After that, 2^6 = 64 and 2^7 = 128, so there’s another carry and another increase in digit-width. I wrote a program to sum the carries and divide them by the power. If I were better at math, I would’ve known what the value of carries / power was going to be. Here’s the program beginning to find it (it begins with a carry of 1, to mark 2^0 = 1 as creating a digit ex nihilo, as it were):


8 = 2^3
16 = 2^4 → 2 / 4 = 0.5
64 = 2^6
128 = 2^7 → 3 / 7 = 0.4285714285714285714285714286
512 = 2^9
1024 = 2^10 → 4 / 10 = 0.4
8192 = 2^13
16384 = 2^14 → 5 / 14 = 0.3571428571428571428571428571
65536 = 2^16
131072 = 2^17 → 6 / 17 = 0.3529411764705882352941176471
524288 = 2^19
1048576 = 2^20 → 7 / 20 = 0.35
8388608 = 2^23
16777216 = 2^24 → 8 / 24 = 0.3...
67108864 = 2^26
134217728 = 2^27 → 9 / 27 = 0.3...
536870912 = 2^29
1073741824 = 2^30 → 10 / 30 = 0.3...
8589934592 = 2^33
17179869184 = 2^34 → 11 / 34 = 0.3235294117647058823529411765
68719476736 = 2^36
137438953472 = 2^37 → 12 / 37 = 0.3243243243243243243243243243
549755813888 = 2^39
1099511627776 = 2^40 → 13 / 40 = 0.325
8796093022208 = 2^43
17592186044416 = 2^44 → 14 / 44 = 0.318...
70368744177664 = 2^46
140737488355328 = 2^47 → 15 / 47 = 0.3191489361702127659574468085
562949953421312 = 2^49
1125899906842624 = 2^50 → 16 / 50 = 0.32
9007199254740992 = 2^53
18014398509481984 = 2^54 → 17 / 54 = 0.3148...
72057594037927936 = 2^56
144115188075855872 = 2^57 → 18 / 57 = 0.3157894736842105263157894737
576460752303423488 = 2^59
1152921504606846976 = 2^60 → 19 / 60 = 0.316...
9223372036854775808 = 2^63
18446744073709551616 = 2^64 → 20 / 64 = 0.3125
73786976294838206464 = 2^66
147573952589676412928 = 2^67 → 21 / 67 = 0.3134328358208955223880597015
590295810358705651712 = 2^69
1180591620717411303424 = 2^70 → 22 / 70 = 0.3142857...
9444732965739290427392 = 2^73
18889465931478580854784 = 2^74 → 23 / 74 = 0.3108...
75557863725914323419136 = 2^76
151115727451828646838272 = 2^77 → 24 / 77 = 0.3116883...
604462909807314587353088 = 2^79
1208925819614629174706176 = 2^80 → 25 / 80 = 0.3125
9671406556917033397649408 = 2^83
19342813113834066795298816 = 2^84 → 26 / 84 = 0.3095238095238095238095238095
77371252455336267181195264 = 2^86
154742504910672534362390528 = 2^87 → 27 / 87 = 0.3103448275862068965517241379
618970019642690137449562112 = 2^89
1237940039285380274899124224 = 2^90 → 28 / 90 = 0.31...
9903520314283042199192993792 = 2^93
19807040628566084398385987584 = 2^94 → 29 / 94 = 0.3085106382978723404255319149
79228162514264337593543950336 = 2^96
158456325028528675187087900672 = 2^97 → 30 / 97 = 0.3092783505154639175257731959
633825300114114700748351602688 = 2^99
1267650600228229401496703205376 = 2^100 → 31 / 100 = 0.31

After calculating 2^p higher and higher (I discarded trailing digits of 2^p), I realized that the answer — carries / power — was converging on a value of slightly less than 0.30103. In the end (doh!), I realized that what I was calculating was the logarithm of 2 in base 10:


log(2) = 0.3010299956639811952137388947...
10^0.301029995663981... = 2

You can use then same carries-and-powers method to approximate the values of other logarithms:


log(1) = 0
log(2) = 0.3010299956639811952137388947...
log(3) = 0.4771212547196624372950279033...
log(4) = 0.6020599913279623904274777894...
log(5) = 0.6989700043360188047862611053...
log(6) = 0.7781512503836436325087667980...
log(7) = 0.8450980400142568307122162586...
log(8) = 0.9030899869919435856412166842...
log(9) = 0.9542425094393248745900558065...

I also realized logarithms are a good answer to the question I raised above: How wide is a number? The logs of the powers of 2 are multiples of log(2):


    log(2^1) = log(2) = 0.301029995663981195213738894
    log(2^2) = log(4) = 0.602059991327962390427477789 = 2 * log(2)
    log(2^3) = log(8) = 0.903089986991943585641216684 = 3 * log(2)
   log(2^4) = log(16) = 1.204119982655924780854955579 = 4 * log(2)
   log(2^5) = log(32) = 1.505149978319905976068694474 = 5 * log(2)
   log(2^6) = log(64) = 1.806179973983887171282433368 = 6 * log(2)
  log(2^7) = log(128) = 2.107209969647868366496172263 = 7 * log(2)
  log(2^8) = log(256) = 2.408239965311849561709911158 = 8 * log(2)
  log(2^9) = log(512) = 2.709269960975830756923650053 = 9 * log(2)
log(2^10) = log(1024) = 3.010299956639811952137388947 = 10 * log(2)

4 is 2 times larger than 2 and, in a sense, the width of 4 is 0.301029995663981… greater than the width of 2. As you can see, when the integer part of the log-sum increases by 1, so does the digit-width of the power:


 log(2^3) = log(8) = 0.903089986991943585641216684 = 3 * log(2)
log(2^4) = log(16) = 1.204119982655924780854955579 = 4 * log(2)

[...]

 log(2^6) = log(64) = 1.806179973983887171282433368 = 6 * log(2)
log(2^7) = log(128) = 2.107209969647868366496172263 = 7 * log(2)

[...]

  log(2^9) = log(512) = 2.709269960975830756923650053 = 9 * log(2)
log(2^10) = log(1024) = 3.01029995663981195213738894 = 10 * log(2)

In other words, powers of 2 are increasing in width by 0.301029995663981… units. When the increase flips the integer part of the log-sum up by 1, the digit-width or digit-count also increases by 1. To find the digit-count of a number, n, in a particular base, you simply take the integer part of log(n,b) and add 1. In base 10, the log of 123456789 is 8.091514… The integer part is 8 and 8+1 = 9. But it also makes perfect sense that log(1) = 0. No matter how many times you multiply a number by 1, the number never changes. That is, its width stays the same. So you can say that 1 has a width of 0, while 2 has a width of 0.301029995663981…

Logarithms also answer a question pre-previously raised on Overlord of the Über-Feral: Why are the Fibonacci numbers so productive in base 11 for digsum(fib(k)) = k? In base 10, such numbers are quickly exhausted:


digsum(fib(1)) = 1 = digsum(1)
digsum(fib(5)) = 5 = digsum(5)
digsum(fib(10)) = 10 = digsum(55)
digsum(fib(31)) = 31 = digsum(1346269)
digsum(fib(35)) = 35 = digsum(9227465)
digsum(fib(62)) = 62 = digsum(4052739537881)
digsum(fib(72)) = 72 = digsum(498454011879264)
digsum(fib(175)) = 175 = digsum(1672445759041379840132227567949787325)
digsum(fib(180)) = 180 = digsum(18547707689471986212190138521399707760)
digsum(fib(216)) = 216 = digsum(619220451666590135228675387863297874269396512)
digsum(fib(251)) = 251 = digsum(12776523572924732586037033894655031898659556447352249)
digsum(fib(252)) = 252 = digsum(20672849399056463095319772838289364792345825123228624)
digsum(fib(360)) = 360
digsum(fib(494)) = 494
digsum(fib(540)) = 540
digsum(fib(946)) = 946
digsum(fib(1188)) = 1188
digsum(fib(2222)) = 2222

In base 11, such numbers go on and on:


digsum(fib(1),b=11) = 1 = digsum(1) (k=1)
digsum(fib(5),b=11) = 5 = digsum(5) (k=5)
digsum(fib(12),b=11) = 12 = digsum(1A2) (k=13)
digsum(fib(38),b=11) = 38 = digsum(855138A1) (k=41)
digsum(fib(49)) = 49 = digsum(2067A724762) (k=53) (c=5)
digsum(fib(50)) = 50 = digsum(542194A6905) (k=55)
digsum(fib(55)) = 55 = digsum(54756364A280) (k=60)
digsum(fib(56)) = 56 = digsum(886283256841) (k=61)
digsum(fib(82)) = 82 = digsum(57751318A9814A6410) (k=90)
digsum(fib(89)) = 89 = digsum(140492673676A06482A2) (k=97)
digsum(fib(144)) = 144 = digsum(401631365A48A784A09392136653457871) (k=169) (c=10)
digsum(fib(159)) = 159 = digsum(67217257641069185100889658A1AA72A0805) (k=185)
digsum(fib(166)) = 166 = digsum(26466A3A88237918577363A2390343388205432) (k=193)
digsum(fib(186)) = 186 = digsum(6A963147A9599623A20A05390315140A21992A96005) (k=215)
digsum(fib(221)) = 221 (k=265) (c=15)
digsum(fib(225)) = 225 (k=269)
digsum(fib(2A1)) = 2A1 (k=353)
digsum(fib(2A3)) = 2A3 (k=355)

[...]

digsum(fib(39409)) = 39409 (k=56395)
digsum(fib(3958A)) = 3958A (k=56605) (c=295)
digsum(fib(3965A)) = 3965A (k=56693)
digsum(fib(3A106)) = 3A106 (k=57360)
digsum(fib(3AA46)) = 3AA46 (k=58493)
digsum(fib(40140)) = 40140 (k=58729)
digsum(fib(4222A)) = 4222A (k=61500) (c=300)
digsum(fib(42609)) = 42609 (k=61961)
digsum(fib(42775)) = 42775 (k=62155)
digsum(fib(4287A)) = 4287A (k=62281)
digsum(fib(430A2)) = 430A2 (k=62669)
digsum(fib(43499)) = 43499 (k=63149) (c=305)
digsum(fib(435A9)) = 435A9 (k=63281)

[...]

digsum(fib(157476)) = 157476 (k=244140) (c=525)
digsum(fib(158470)) = 158470 (k=245465)
digsum(fib(159037)) = 159037 (k=246275)
digsum(fib(159285)) = 159285 (k=246570)
digsum(fib(159978)) = 159978 (k=247409)
digsum(fib(162993)) = 162993 (k=252750) (c=530)
digsum(fib(163A32)) = 163A32 (k=254135)
digsum(fib(164918)) = 164918 (k=255329)
digsum(fib(166985)) = 166985 (k=258065)
digsum(fib(167234)) = 167234 (k=258493)
digsum(fib(167371)) = 167371 (k=258655) (c=535)
digsum(fib(1676A5)) = 1676A5 (k=259055)
digsum(fib(16992A)) = 16992A (k=261997)

[...]

When do these numbers run out in base 11? I don’t know, but I do know why there are so many of them. The answer involves the logarithm of a special number. The most famous aspect of Fibonacci numbers is that the ratio, fib(k) / fib(k-1), of successive numbers converges on an irrational constant known as Φ. Here are the first Fibonacci numbers, where fib(k) = fib(k-2) + fib(k-1) (in other words, 1+1 = 2, 1+2 = 3, 2+3 = 5, and so on):


1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, ...

And here are the first ratios:


1 / 1 = 1
2 / 1 = 2
3 / 2 = 1.5
5 / 3 = 1.6...
8 / 5 = 1.6
13 / 8 = 1.625
21 / 13 = 1.6153846...
34 / 21 = 1.619047...
55 / 34 = 1.617647058823529411764705882
89 / 55 = 1.618...
144 / 89 = 1.617977528089887640449438202
233 / 144 = 1.61805...
377 / 233 = 1.618025751072961373390557940
610 / 377 = 1.618037135278514588859416446
987 / 610 = 1.618032786885245901639344262
1597 / 987 = 1.618034447821681864235055724
2584 / 1597 = 1.618033813400125234815278648
4181 / 2584 = 1.618034055727554179566563468
6765 / 4181 = 1.618033963166706529538387946
[...]

The ratios get closer and closer to Φ = 1.618033988749894848204586834… = (√5 + 1) / 2. In other words, fib(k) ≈ fib(k-1) * Φ = fib(k-1) * 1.618… in base 10. This means that the digit-length of fib(k) ≈ integer(k * log(&Phi)) + 1. In base b, the average value of a digit in a Fibonacci number is (b^2-b) / 2b. Therefore in base 10, the average value of a digit is (10^2-10) / 20 = 90 / 20 = 4.5. The average value of digsum(fib(k)) ≈ 4.5 * log(&Phi) * k = 4.5 * 0.20898764… * k = 0.940444… * k. It isn’t surprising that as fib(k) gets larger, digsum(fib(k)) tends to get smaller than k.

In base 10, anyway. But what about base 11? In base 11, log(Φ) = 0.20068091818623… and the average value of a base-11 digit in fib(k) is 5 = 110 / 22 = (11^2 – 11) / 22. Therefore the average value of digsum(fib(k)) in base 11 is 5 * log(&Phi) * k = 5 * 0.20068091818623… * k = 1.00340459… * k. The average value of digsum(fib(k)) is much closer to k and it’s not surprising that for so many fib(k) in base 11, digsum(fib(k)) = k. In base 11, log(Φ) ≈ 1/5 and because the average digval is 5, digsum(fib(k)) ≈ 5 * 1/5 * k = 1 * k = k. As we’ve seen, that isn’t true in base 10. Nor is it true in base 12, where log(Φ) = 0.1936538843826… and average digval is 5.5 = (12^2 – 12) / 24 = 132 / 24. Therefore the average value in base 12 of digsum(fib(k)) = 1.0650963641… * k. The function digsum(fib(k)) = k rapidly dries up in base 12, just as it does in base 10:


digsum(fib(1),b=12) = 1 = digsum(1) (k=1)
digsum(fib(5),b=12) = 5 = digsum(5) (k=5)
digsum(fib(11) = 11 = digsum(175) (k=13)
digsum(fib(12) = 12 = digsum(275) (k=14)
digsum(fib(75) = 75 = digsum(976446538A0863811) (k=89) (c=5)
digsum(fib(80) = 80 = digsum(1B3643B50939808B400) (k=96)
digsum(fib(A3) = A3 = digsum(35147A566682BB9529034402) (k=123)
digsum(fib(165) = 165 (k=221)
digsum(fib(283) = 283 (k=387)
digsum(fib(2AB) = 2AB (k=419) (c=10)
digsum(fib(39A) = 39A (k=550)
digsum(fib(460) = 460 (k=648)
digsum(fib(525) = 525 (k=749)
digsum(fib(602) = 602 (k=866)
digsum(fib(624) = 624 (k=892) (c=15)
digsum(fib(781) = 781 (k=1105)
digsum(fib(1219) = 1219 (k=2037)


Previously Pre-Posted…

Mötley Vüe — more on digsum(fib(k)) = k

Twi-Phi

Here’s a pentagon:

Stage #1


And here’s the pentagon with smaller pentagons on its vertices:

Stage #2


And here’s more of the same:

Stage #3


Stage #4


Stage #5


Stage #6


Stage #7


Stage #8


Animated fractal


At infinity, the smaller pentagons have reached out like arms to exactly fill the gaps between themselves without overlapping. But how much smaller is each set of smaller pentagons than its mother-pentagon when the gaps are exactly filled? Well, if the radius of the mother-pentagon is r, then the radius of each daughter-pentagon is r * 1/(φ^2) = r * 0·38196601125…

But what happens if the radius relationship of mother to daughter is r * 1/φ = r * 0·61803398874 = r * (φ-1)? Then you get this fractal:

Stage #1


Stage #2


Stage #3


Stage #4


Stage #5


Stage #6


Stage #7


Stage #8


Stage #9


Animated fractal


Mötley Vüe

Here’s the Fibonacci sequence, where each term (after the first two) is created by adding the two previous numbers:


1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765...

In “Fib and Let Tri”, I described how my eye was caught by 55, which is a palindrome, reading the same backwards and forwards. “Were there any other Fibonacci palindromes?” I wondered. So I looked to see. Now my eye has been caught by 55 again, but for another reason. It should be easy to spot another interesting aspect to 55 when the Fibonacci numbers are set out like this:


fib(1) = 1
fib(2) = 1
fib(3) = 2
fib(4) = 3
fib(5) = 5
fib(6) = 8
fib(7) = 13
fib(8) = 21
fib(9) = 34
fib(10) = 55
fib(11) = 89
fib(12) = 144
fib(13) = 233
fib(14) = 377
fib(15) = 610
fib(16) = 987
fib(17) = 1597
fib(18) = 2584
fib(19) = 4181
fib(20) = 6765
[...]

55 is fib(10), the 10th Fibonacci number, and 5+5 = 10. That is, digsum(fib(10)) = 10. What other Fibonacci numbers work like that? I soon found some and confirmed my answer at the Online Encyclopedia of Integer Sequences:


1, 5, 10, 31, 35, 62, 72, 175, 180, 216, 251, 252, 360, 494, 504, 540, 946, 1188, 2222 — A020995 at OEIS

And that seems to be the lot, according to the OEIS. In base 10, at least, but why stop at base 10? When I looked at base 11, the numbers of digsum(fib(k)) = k didn’t stop coming, because I couldn’t take the Fibonacci numbers very high on my computer. But the OEIS gives a much longer list, starting like this:


1, 5, 13, 41, 53, 55, 60, 61, 90, 97, 169, 185, 193, 215, 265, 269, 353, 355, 385, 397, 437, 481, 493, 617, 629, 630, 653, 713, 750, 769, 780, 889, 905, 960, 1013, 1025, 1045, 1205, 1320, 1405, 1435, 1501, 1620, 1650, 1657, 1705, 1735, 1769, 1793, 1913, 1981, 2125, 2153, 2280, 2297, 2389, 2413, 2460, 2465, 2509, 2533, 2549, 2609, 2610, 2633, 2730, 2749, 2845, 2893, 2915, 3041, 3055, 3155, 3209, 3360, 3475, 3485, 3521, 3641, 3721, 3749, 3757, 3761, 3840, 3865, 3929, 3941, 4075, 4273, 4301, 4650, 4937, 5195, 5209, 5435, 5489, 5490, 5700, 5917, 6169, 6253, 6335, 6361, 6373, 6401, 6581, 6593, 6701, 6750, 6941, 7021, 7349, 7577, 7595, 7693, 7740, 7805, 7873, 8009, 8017, 8215, 8341, 8495, 8737, 8861, 8970, 8995, 9120, 9133, 9181, 9269, 9277, 9535, 9541, 9737, 9935, 9953, 10297, 10609, 10789, 10855, 11317, 11809, 12029, 12175... — A025490 at OEIS

The list ends with 1636597 = A18666[b11] and the OEIS says that 1636597 almost certainly completes the list. According to David C. Terr’s paper “On the Sums of Fibonacci Numbers” (pdf), published in the Fibonacci Quarterly in 1996, the estimated digit-sum for the k-th Fibonacci number in base b is given by the formula (b-1)/2 * k * log(b,φ), where log(b,φ) is the logarithm in base b of the golden ratio, 1·61803398874… Terr then notes that the simplified formula (b-1)/2 * log(b,φ) gives the estimated average ratio digsum(fib(k)) / k in base b. Here are the estimates for bases 2 to 20:


b02 = 0.3471209568153086...
b03 = 0.4380178794859424...
b04 = 0.5206814352229629...
b05 = 0.5979874356654401...
b06 = 0.6714235829697111...
b07 = 0.7418818776805580...
b08 = 0.8099488992357201...
b09 = 0.8760357589718848...
b10 = 0.9404443811249043...
b11 = 1.0034045909311624...
b12 = 1.0650963641043091...
b13 = 1.1256639207937723...
b14 = 1.1852250528196852...
b15 = 1.2438775226715552...
b16 = 1.3017035880574074...
b17 = 1.3587732842474014...
b18 = 1.4151468584732730...
b19 = 1.4708766105122322...
b20 = 1.5260083080264088...

In base 2, you can expect digsum(fib(k)) to be much smaller than k; in base 20, you can expect digsum(fib(k)) to be much larger. But as you can see, the estimate for base 11, 1.0034045909311624…, is very nearly 1. That’s why base 11 produces so many results for digsum(fib(k)) = k, because only a slight deviation from the estimate might create a perfect ratio of 1 for digsum(fib(k)) / k, i.e. digsum(fib(k)) = k. But in the end the results run out in base 11 too, because as k gets higher and fib(k) gets bigger, the estimate becomes more and more accurate and digsum(fib(k)) > k. With lower k, digsum(fib(k)) can easily fall below k or match k. That happens in other bases, but because their estimates are further from 1, results for digsum(fib(k)) = k run out much more quickly.

To see this base behavior represented visually, I’ve created Ulam-like spirals for k using three colors: blue for digsum(fib(k)) < k, yellow for digsum(fib(k)) > k, and red for digsum(fib(k)) = k (with the green square at the center representing fib(1) = 1). As you can see below, the spiral for base 11 immediately stands out. It’s motley, not dominated by blue or yellow like the other spirals:

Spiral for digsum(fib(k)) in base 9
(blue for digsum(fib(k)) < k, yellow for digsum(fib(k)) > k, red for digsum(fib(k)) = k, green for fib(1))


Spiral for digsum(fib(k)) in base 10


Spiral for digsum(fib(k)) in base 11 — a motley view of blue, yellow and red


Spiral for digsum(fib(k)) in base 12


Spiral for digsum(fib(k)) in base 13


Finally, here are spirals at higher and higher resolution for digsum(fib(k)) = k in base 11:

digsum(fib(k)) = k in base 11 (low resolution)
(green square is fib(1))


digsum(fib(k)) = k in base 11 (x2 resolution)


digsum(fib(k)) = k in base 11 (x4)


digsum(fib(k)) = k in base 11 (x8)


digsum(fib(k)) = k in base 11 (x16)


digsum(fib(k)) = k in base 11 (x32)


digsum(fib(k)) = k in base 11 (x64)


digsum(fib(k)) = k in base 11 (x128)


digsum(fib(k)) = k in base 11 (animated)