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