The Fibonacci Repequence

Start with 0 and 1, then add the previous two numbers, then repeat. What do you get? You get the Fibonacci sequence:

0, 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,…

Apart from the two 1s, every number in the Fibonacci sequence is unique. But what about the leftmost digits of the Fibonacci numbers? If you think about it, you’ll see that they have to fall into a repeating pattern, like this:

0, 1, 1, 2, 3, 5, 8, 3, 1, 4, 5, 9, 4, 3, 7, 0, 7, 7, 4, 1, 5, 6, 1, 7, 8, 5, 3, 8, 1, 9, 0, 9, 9, 8, 7, 5, 2, 7, 9, 6, 5, 1, 6, 7, 3, 0, 3, 3, 6, 9, 5, 4, 9, 3, 2, 5, 7, 2, 9, 1, 0, 1, 1, 2, 3, 5, 8, 3, 1, 4, 5, 9, 4, 3, 7, 0, 7, 7, 4, 1, 5, 6, 1, 7, 8, 5, 3, 8, 1, 9, 0, 9, 9, 8, 7, 5, 2, 7, 9, 6, 5,

But that’s in base 10. Here’s the Fibonacci sequence in some other bases:

b02: 1, 1, 10, 11, 101, 1000, 1101, 10101, 100010, 110111, 1011001, 10010000, 11101001, 101111001, 1001100010,…
b03: 1, 1, 2, 10, 12, 22, 111, 210, 1021, 2001, 10022, 12100, 22122, 111222, 211121,…
b04: 1, 1, 2, 3, 11, 20, 31, 111, 202, 313, 1121, 2100, 3221, 11321, 21202,…
b05: 1, 1, 2, 3, 10, 13, 23, 41, 114, 210, 324, 1034, 1413, 3002, 4420,…
b06: 1, 1, 2, 3, 5, 12, 21, 33, 54, 131, 225, 400, 1025, 1425, 2454,…
b07: 1, 1, 2, 3, 5, 11, 16, 30, 46, 106, 155, 264, 452, 1046, 1531,…
b08: 1, 1, 2, 3, 5, 10, 15, 25, 42, 67, 131, 220, 351, 571, 1142,…
b09: 1, 1, 2, 3, 5, 8, 14, 23, 37, 61, 108, 170, 278, 458, 747,…
b10: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610,…

And here are the trailing digits in the other bases:

b02: 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0,…
b03: 0, 1, 1, 2, 0, 2, 2, 1, 0, 1, 1, 2, 0, 2, 2, 1, 0, 1, 1, 2, 0, 2, 2, 1, 0, 1, 1, 2, 0, 2, 2,…
b04: 0, 1, 1, 2, 3, 1, 0, 1, 1, 2, 3, 1, 0, 1, 1, 2, 3, 1, 0, 1, 1, 2, 3, 1, 0, 1, 1, 2, 3, 1, 0,…
b05: 0, 1, 1, 2, 3, 0, 3, 3, 1, 4, 0, 4, 4, 3, 2, 0, 2, 2, 4, 1, 0, 1, 1, 2, 3, 0, 3, 3, 1, 4, 0,…
b06: 0, 1, 1, 2, 3, 5, 2, 1, 3, 4, 1, 5, 0, 5, 5, 4, 3, 1, 4, 5, 3, 2, 5, 1, 0, 1, 1, 2, 3, 5, 2,…
b07: 0, 1, 1, 2, 3, 5, 1, 6, 0, 6, 6, 5, 4, 2, 6, 1, 0, 1, 1, 2, 3, 5, 1, 6, 0, 6, 6, 5, 4, 2, 6,…
b08: 0, 1, 1, 2, 3, 5, 0, 5, 5, 2, 7, 1, 0, 1, 1, 2, 3, 5, 0, 5, 5, 2, 7, 1, 0, 1, 1, 2, 3, 5, 0,…
b09: 0, 1, 1, 2, 3, 5, 8, 4, 3, 7, 1, 8, 0, 8, 8, 7, 6, 4, 1, 5, 6, 2, 8, 1, 0, 1, 1, 2, 3, 5, 8,…
b10: 0, 1, 1, 2, 3, 5, 8, 3, 1, 4, 5, 9, 4, 3, 7, 0, 7, 7, 4, 1, 5, 6, 1, 7, 8, 5, 3, 8, 1, 9, 0,…

But what are the relative counts for those trailing digits? You can show them on a graph. Here’s the graph for the relative counts of trailing digits in base 10:

Count of trailing fib-digits in base 10 = 2*5


The blue dot marks the count for the digit 1, with the count for the digit 0 to its left. The green dot marks the digit 5 and the red dot marks the digit 10. Of course, there is no single digit for 10 in base 10, but to make the graph symmetrical I’ve reproduced the column for 0. However, it’s impossible to make a digit-count graph symmetrical for all base b, as you can see here:

Relative count of trailing fib-digits in base 2 (prime)


Relative count of trailing fib-digits in base 3 (prime)


Fibdig-counts in base 4 = 2^2


Fibdig-counts in base 5 (prime)


Fibdig-counts in base 6 = 2.3


Fibdig-counts in base 7 (prime)


Fibdig-counts in base 8 = 2^3


Fibdig-counts in base 9 = 3^2


Count of trailing fib-digits in base 10 = 2*5


Some graphs are symmetrical, some are not; some digits occur for fibnum(i) mod base, some don’t. Here are some more of the symmetrical graphs in higher bases:

Fibdig-counts in base 23 (prime)


Fibdig-counts in base 30 = 2.3.5


Fibdig-counts in base 70 = 2.5.7


Fibdig-counts in base 98 = 2.7^2


Fibdig-counts in base 104 = 2^3.13


It’s also interesting to see the behavior of bases that are themselves Fibonacci numbers. The lower trailing digits of fibnum(i) match the Fibonacci numbers themselves — 0, 1, 2, 3, 5, 8, 13, 21, … — skipping those numbers that aren’t Fibonacci numbers. And symmetrical graphs are interspersed with asymmetrical ones:

Fibdig-counts in base 34 = 2.17


Fibdig-counts in base 55 = 5.11


Fibdig-counts in base 89 (prime)


Fibdig-counts in base 144 = 2^4.3^2

Fibdig-counts in base 233 (prime)


Fibdig-counts in base 377 = 13.29


Fibdig-counts in base 610 = 2.5.61


The patterns for bases that are Fibonacci numbers are echoed by the patterns for bases that are Lucas numbers, which are formed in the same way as Fibonacci numbers but are seeded with (2, 1) rather than (0, 1):

2, 1, 3, 4, 7, 11, 18, 29, 47, 76, 123, 199, 322, 521, 843, 1364, 2207, 3571, 5778, 9349, 15127, 24476, 39603, 64079, 103682, 167761, 271443, 439204, 710647, 1149851, 1860498, 3010349, 4870847, 7881196, 12752043, 20633239, 33385282, 54018521, 87403803, … — Lucas numbers, A000032 at the Online Encyclopedia of Integer Sequences

Here are some graphs in bases that are Lucas numbers:

Fibdig-counts in base 47 (prime)


Fibdig-counts in base 76 = 2.23


Fibdig-counts in base 123 = 3.41


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.