Square on a Three String

222 A.D. was the year in which the Emperor Heliogabalus was assassinated by his own soldiers. Exactly 1666 years later, the Anglo-Dutch classicist Sir Lawrence Alma-Tadema exhibited his painting The Roses of Heliogabalus (1888). I suggested in “Roses Are Golden” that Alma-Tadema must have chosen the year as deliberately as he chose the dimensions of his canvas, which, at 52″ x 84 1/8“, is an excellent approximation to the golden ratio.

But did Alma-Tadema know that lines at 0º and 222º divide a circle in the golden ratio? He could easily have done, just as he could easily have known that 222 precedes the 48th prime, 223. But it is highly unlikely that he knew that 223 yields a magic square whose columns, rows and diagonals all sum to 222. To create the square, simply list the 222 multiples of the reciprocal 1/223 in base 3, or ternary. The digits of the reciprocal repeat after exactly 222 digits and its multiples begin and end like this:

001/223 = 0.00001002102101021212111012022211122022... in base 3
002/223 = 0.00002011211202120201222101122200021121...
003/223 = 0.00010021021010212121110120222111220221...
004/223 = 0.00011100200112011110221210022100120020...
005/223 = 0.00012110002220110100102222122012012120...

[...]

218/223 = 0.22210112220002112122120000100210210102... in base 3
219/223 = 0.22211122022110211112001012200122102202...
220/223 = 0.22212201201212010101112102000111002001...
221/223 = 0.22220211011020102021000121100022201101...
222/223 = 0.22221220120121201010111210200011100200...

Each column, row and diagonal of ternary digits sums to 222. Here is the full n/223 square represented with 0s in grey, 1s in white and 2s in red:

(Click for larger)


It isn’t difficult to see that the white squares are mirror-symmetrical on a horizontal axis. Here is the symmetrical pattern rotated by 90º:

(Click for larger)


But why should the 1s be symmetrical? This isn’t something special to 1/223, because it happens with prime reciprocals like 1/7 too:

1/7 = 0.010212... in base 3
2/7 = 0.021201...
3/7 = 0.102120...
4/7 = 0.120102...
5/7 = 0.201021...
6/7 = 0.212010...

And you can notice something else: 0s mirror 2s and 2s mirror 0s. A related pattern appears in base 10:

1/7 = 0.142857...
2/7 = 0.285714...
3/7 = 0.428571...
4/7 = 0.571428...
5/7 = 0.714285...
6/7 = 0.857142...

The digit 1 in the decimal digits of n/7 corresponds to the digit 8 in the decimal digits of (7-n)/7; 4 corresponds to 5; 2 corresponds to 7; 8 corresponds to 1; 5 corresponds to 4; and 7 corresponds to 2. In short, if you’re given the digits d1 of n/7, you know the digits d2 of (n-7)/7 by the rule d2 = 9-d1.

Why does that happen? Examine these sums:

 1/7 = 0.142857142857142857142857142857142857142857...
+6/7 = 0.857142857142857142857142857142857142857142...
 7/7 = 0.999999999999999999999999999999999999999999... = 1.0

 2/7 = 0.285714285714285714285714285714285714285714...
+5/7 = 0.714285714285714285714285714285714285714285...
 7/7 = 0.999999999999999999999999999999999999999999... = 1.0

 3/7 = 0.428571428571428571428571428571428571428571...
+4/7 = 0.571428571428571428571428571428571428571428...
 7/7 = 0.999999999999999999999999999999999999999999... = 1.0

And here are the same sums in ternary (where the first seven integers are 1, 2, 10, 11, 12, 20, 21):

  1/21 = 0.010212010212010212010212010212010212010212...
+20/21 = 0.212010212010212010212010212010212010212010...
 21/21 = 0.222222222222222222222222222222222222222222... = 1.0

  2/21 = 0.021201021201021201021201021201021201021201...
+12/21 = 0.201021201021201021201021201021201021201021...
 21/21 = 0.222222222222222222222222222222222222222222... = 1.0

 10/21 = 0.102120102120102120102120102120102120102120...
+11/21 = 0.120102120102120102120102120102120102120102...
 21/21 = 0.222222222222222222222222222222222222222222... = 1.0

Accordingly, in base b with the prime p, the digits d1 of n/p correspond to the digits (p-n)/p by the rule d2 = (b-1)-d1. This explains why the 1s mirror themselves in ternary: 1 = 2-1 = (3-1)-1. In base 5, the 2s mirror themselves by the rule 2 = 4-2 = (5-1) – 2. In all odd bases, some digit will mirror itself; in all even bases, no digit will. The mirror-digit will be equal to (b-1)/2, which is always an integer when b is odd, but never an integer when b is even.

Here are some more examples of the symmetrical patterns found in odd bases:

Patterns of 1s in 1/19 in base 3


Patterns of 6s in 1/19 in base 13


Patterns of 7s in 1/19 in base 15


Elsewhere other-posted:

Roses Are Golden — more on The Roses of Heliogabalus (1888)
Three Is The Key — more on the 1/223 square

Get Your Ox Off

Boustrophedon (pronounced “bough-stra-FEE-dun” or “boo-stra-FEE-dun”) is an ancient Greek word literally meaning “as the ox turns (in ploughing)”, that is, moving left-right, right-left, and so on. The word is used of writing that runs down the page in the same way. To see what that means, examine two versions of the first paragraph of Clark Ashton Smith’s story “The Demon of the Flower” (1933). The first is written in the usual way, the second is written boustrophedon:

Not as the plants and flowers of Earth, growing peacefully beneath a simple sun, were the blossoms of the planet Lophai. Coiling and uncoiling in double dawns; tossing tumultuously under vast suns of jade green and balas-ruby orange; swaying and weltering in rich twilights, in aurora-curtained nights, they resembled fields of rooted servants that dance eternally to an other-worldly music.


Not as the plants and flowers of Earth, growing peacefully
.iahpoL tenalp eht fo smossolb eht erew ,nus elpmis a htaeneb
Coiling and uncoiling in double dawns; tossing tumultuously
;egnaro ybur-salab dna neerg edaj fo snus tsav rednu
swaying and weltering in rich twilights, in aurora-curtained
ecnad taht stnavres detoor fo sdleif delbmeser yeht ,sthgin
eternally to an other-worldly music.


Boustrophedon writing was once common and sometimes the left-right lines would also be mirror-reversed, like this:


You could also use the term “boustrophedon” to describe the way this table of numbers is filled:

primes_table


The table begins with “1” in the top left-hand corner, then moves right for “2”, then down for “3”, then right-and-up for “4”, “5” and “6”, then right for “7”, then left-and-down for “8”, “9” and “10”, and so on. You could also say that the numbers snake through the table. I’ve marked the primes among them, because I was interested in the patterns made by the primes when the numbers were represented as blocks on a grid, like this:

primes_large


Primes are in solid white (compare the Ulam spiral). Here’s the boustrophedon prime-grid on a finer scale:

primes

(click for full image)


And what about other number-tests? Here are the even numbers marked on the grid (i.e. n mod 2 = 0):

mod2

n mod 2 = 0


And here are some more examples of a modulus test:

mod3

n mod 3 = 0


mod5

n mod 5 = 0


mod9

n mod 9 = 0


mod15

n mod 15 = 0


mod_various

n mod various = 0 (animated gif)


Next I looked at reciprocals (numbers divided into 1) marked on the grid, with the digits of a reciprocal marking the number of blank squares before a square is filled in (if the digit is “0”, the square is filled immediately). For example, in base ten 1/7 = 0.142857142857142857…, where the block “142857” repeats for ever. When represented on the grid, 1/7 has 1 blank square, then a filled square, then 4 blank squares, then a filled square, then 2 blank squares, then a filled square, and so on:

recip7_base10

1/7 in base 10


And here are some more reciprocals (click for full images):

recip9_base2

1/9 in base 2


recip13_base10

1/13 in base 10


recip27_base10

1/27 in base 10


recip41_base10

1/41 in base 10


recip63_base10

1/63 in base 10


recip82_base10

1/82 in base 10


recip101_base10

1/101 in base 10


recip104_base10

1/104 in base 10


recip124_base10

1/124 in base 10


recip143_base10

1/143 in base 10


recip175_base10

1/175 in base 10


recip604_base8

1/604 in base 8


recip_various

1/n in various bases (animated gif)


Amateur ’Grammatics

There is much more to mathematics than mathematics. Like a tree, it has deep roots. Like a tree, it’s affected by its environment. Philosophy of mathematics is concerned with the roots. Psychology of mathematics is concerned with the environment.

On Planet Earth, the environment is human beings. What attracts men and women to the subject? What makes them good or bad at it?And so on. One interesting answer to the first question was supplied by the mathematician Stanislaw Ulam (1909-84), who wrote this in his autobiography:

“In many cases, mathematics is an escape from reality. The mathematician finds his own monastic niche and happiness in pursuits that are disconnected from external affairs. Some practice it as if using a drug.” – Adventures of a Mathematician (1983)

That’s certainly part of maths’ appeal to me: as an escape from reality, or an escape from one reality into another (and deeper). Real life is messy. Maths isn’t, unless you want it to be. But you can find parallels between maths and real life too. In real life, people collect things that they find attractive or interesting: stamps, sea-shells, gems, cigarette-cards, beer-cans and so on. You can collect things in maths too: interesting numbers and number patterns. Recreational maths can feel like looking on a beach for attractive shells and pebbles.

Here’s a good example: digital anagrams, or numbers in different bases whose digits are the same but re-arranged. For example, 13 in base 10 equals 31 in base 4, because 13 = 3 * 4 + 1. To people with the right kind of mind, that’s an interesting and attractive pattern. There are lots more anagrams like that:

1045 = 4501 in base 6
1135 = 5131 in base 6

23 = 32 in base 7
46 = 64 in base 7

1273 = 2371 in base 8
1653 = 3165 in base 8

158 = 185 in base 9
227 = 272 in base 9

196 = 169 in base 11
283 = 238 in base 11

2193 = 1329 in base 12
6053 = 3605 in base 12

43 = 34 in base 13
86 = 68 in base 13

But triple anagrams, involving three bases, seem even more attractive:

913 = 391 in base 16 = 193 in base 26
103462 = 610432 in base 7 = 312046 in base 8
245183 = 413285 in base 9 = 158234 in base 11

And that’s just looking in base 10. If you include all bases, the first double anagram is in fact 21 in base 3 = 12 in base 5 (equals 7 in base 10). The first triple anagram is this:

2C1 in base 13 = 1C2 in base 17 = 12C in base 21 (equals 495 in base 10)

But are there quadruple anagrams, quintuple anagrams and higher? I don’t know. I haven’t found any and it gets harder and harder to search for them, because the bigger n gets, the more bases there are to check. However, I can say one thing for certain: in any given base, anagrams eventually disappear.

To understand why, consider the obvious fact that anagrams have to have the same number of digits in different bases. But the number of digits is a function of the powers of the base. That is, the triple anagram 103462 (see above) has six digits in bases 7, 8 and 10 because 7^5 < 103462 < 7^6, 8^5 < 103462 < 8^6 and 10^5 < 103462 < 10^6. Similarly, the triple anagram 245183 (ditto) has six digits in bases 9, 10 and 11 because 9^5 < 245183 < 9^6, 10^5 < 245183 < 10^6 and 11^5 < 245183 < 11^6:

7^5 < 103462 < 7^6
16807 < 103462 < 117649
8^5 < 103462 < 8^6
32768 < 103462 < 262144
10^5 < 103462 < 10^6
100000 < 103462 < 1000000
9^5 < 245183 < 9^6
59049 < 245183 < 531441
10^5 < 245183 < 10^6
100000 < 245183 < 1000000
11^5 < 245183 < 11^6
161051 < 245183 < 1771561

In other words, for some n the number-lengths of bases 7 and 8 overlap the number-lengths of base 10, which overlap the number-lengths of bases 9 and 11. But eventually, as n gets larger, the number-lengths of base 10 will fall permanently below the number-lengths of bases 7, 8 and 9, just as the number-lengths of base 11 will fall permanently below the number-lengths of base 10.

To see this in action, consider the simplest example: number-lengths in bases 2 and 3. There is no anagram involving these two bases, because only two numbers have the same number of digits in both: 1 and 3 = 11 in base 2 = 10 in base 3. After that, n in base 2 always has more digits than n in base 3:

2^0 = 1 in base 2 (number-length=1) = 1 in base 3 (l=1)
2^1 = 2 = 10 in base 2 (number-length=2) = 2 in base 3 (l=1)
2^2 = 4 = 100 in base 2 (l=3) = 11 in base 3 (l=2)
2^3 = 8 = 1000 in base 2 = 22 in base 3 (l=2)
2^4 = 16 = 10000 in base 2 = 121 in base 3 (l=3)
2^5 = 32 = 1012 in base 3 (l=4)
2^6 = 64 = 2101 in base 3 (l=4)
2^7 = 128 = 11202 in base 3 (l=5)
2^8 = 256 = 100111 in base 3 (l=6)
2^9 = 512 = 200222 in base 3 (l=6)
2^10 = 1024 = 1101221 in base 3 (l=7)

Now consider bases 3 and 4. Here is an anagram using these bases: 211 in base 3 = 112 in base 4 = 22. There are no more anagrams and eventually there’s no more chance for them to occur, because this happens as n gets larger:

3^0 = 1 in base 3 (number-length=1) = 1 in base 4 (l=1)
3^1 = 3 = 10 in base 3 (number-length=2) = 3 in base 4 (l=1)
3^2 = 9 = 100 in base 3 (l=3) = 21 in base 4 (l=2)
3^3 = 27 = 1000 in base 3 (l=4) = 123 in base 4 (l=3)
3^4 = 81 = 10000 in base 3 (l=5) = 1101 in base 4 (l=4)
3^5 = 243 = 100000 in base 3 (l=6) = 3303 in base 4 (l=4)
3^6 = 729 = 23121 in base 4 (l=5)
3^7 = 2187 = 202023 in base 4 (l=6)
3^8 = 6561 = 1212201 in base 4 (l=7)
3^9 = 19683 = 10303203 in base 4 (l=8)
3^10 = 59049 = 32122221 in base 4 (l=8)
3^11 = 177147 = 223033323 in base 4 (l=9)
3^12 = 531441 = 2001233301 in base 4 (l=10)
3^13 = 1594323 = 12011033103 in base 4 (l=11)
3^14 = 4782969 = 102033231321 in base 4 (l=12)
3^15 = 14348907 = 312233021223 in base 4 (l=12)
3^16 = 43046721 = 2210031131001 in base 4 (l=13)
3^17 = 129140163 = 13230220113003 in base 4 (l=14)
3^18 = 387420489 = 113011321011021 in base 4 (l=15)
3^19 = 1162261467 = 1011101223033123 in base 4 (l=16)
3^20 = 3486784401 = 3033311001232101 in base 4 (l=16)

When n is sufficiently large, it always has fewer digits in base 4 than in base 3. And the gap gets steadily bigger. When n doesn’t have the same number of digits in two bases, it can’t be an anagram. A similar number-length gap eventually appears in bases 4 and 5, but the anagrams don’t run out as quickly there:

103 in base 5 = 130 in base 4 = 28
1022 in base 5 = 2021 in base 4 = 137
1320 in base 5 = 3102 in base 4 = 210
10232 in base 5 = 22310 in base 4 = 692
10332 in base 5 = 23031 in base 4 = 717
12213 in base 5 = 32211 in base 4 = 933
100023 in base 5 = 301002 in base 4 = 3138
100323 in base 5 = 302031 in base 4 = 3213
102131 in base 5 = 311120 in base 4 = 3416
102332 in base 5 = 312023 in base 4 = 3467
103123 in base 5 = 313102 in base 4 = 3538
1003233 in base 5 = 3323010 in base 4 = 16068

Base 10 isn’t exempt. Eventually it must outshrink base 9 and be outshrunk by base 11, so what is the highest 9:10 anagram and highest 10:11 anagram? I don’t know: my maths isn’t good enough for me to find out quickly. But using machine code, I’ve found these large anagrams:

205888888872731 = 888883178875022 in base 9
1853020028888858 = 8888888525001032 in base 9
16677181388880888 = 88888888170173166 in base 9

999962734025 = 356099992472 in base 11
9999820360965 = 3205999998606 in base 11
99999993520348 = 29954839390999 in base 11

Note how the digits of n in the lower base are increasing as the digits of n in the higher base are decreasing. Eventually, n in the lower base will always have more digits than n in the higher base. When that happens, there will be no more anagrams.

Some triple anagrams

2C1 in base 13 = 1C2 in base 17 = 12C in base 21 (n=495 = 3^2*5*11)
912 in base 10 = 219 in base 21 = 192 in base 26 (2^4*3*19)
913 in base 10 = 391 in base 16 = 193 in base 26 (11*83)
4B2 in base 15 = 42B in base 16 = 24B in base 22 (n=1067 = 11*97)
5C1 in base 17 = 51C in base 18 = 1C5 in base 35 (n=1650 = 2*3*5^2*11)
3L2 in base 26 = 2L3 in base 31 = 23L in base 35 (n=2576 = 2^4*7*23)
3E1 in base 31 = 1E3 in base 51 = 13E in base 56 (n=3318 = 2*3*7*79)
531 in base 29 = 351 in base 37 = 135 in base 64 (n=4293 = 3^4*53)
D53 in base 18 = 53D in base 29 = 35D in base 37 (n=4305 = 3*5*7*41)
53I in base 29 = 3I5 in base 35 = 35I in base 37 (n=4310 = 2*5*431)
825 in base 25 = 582 in base 31 = 258 in base 49 (n=5055 = 3*5*337)
6S2 in base 31 = 2S6 in base 51 = 26S in base 56 (n=6636 = 2^2*3*7*79)
D35 in base 23 = 5D3 in base 36 = 3D5 in base 46 (n=6951 = 3*7*331)
3K1 in base 49 = 31K in base 52 = 1K3 in base 81 (n=8184 = 2^3*3*11*31)
A62 in base 29 = 6A2 in base 37 = 26A in base 64 (n=8586 = 2*3^4*53)
9L2 in base 30 = 92L in base 31 = 2L9 in base 61 (n=8732 = 2^2*37*59)
3W1 in base 49 = 1W3 in base 79 = 13W in base 92 (n=8772 = 2^2*3*17*43)
G4A in base 25 = AG4 in base 31 = 4AG in base 49 (n=10110 = 2*3*5*337)
J10 in base 25 = 1J0 in base 100 = 10J in base 109 (n=11900 = 2^2*5^2*7*17)
5[41]1 in base 46 = 1[41]5 in base 93 = 15[41] in base 109 (n=12467 = 7*13*137)
F91 in base 29 = 9F1 in base 37 = 19F in base 109 (n=12877 = 79*163)
F93 in base 29 = 9F3 in base 37 = 39F in base 64 (n=12879 = 3^5*53)
AP4 in base 35 = A4P in base 36 = 4AP in base 56 (n=13129 = 19*691)
BP2 in base 36 = B2P in base 37 = 2PB in base 81 (n=15158 = 2*11*13*53)
O6F in base 25 = FO6 in base 31 = 6FO in base 49 (n=15165 = 3^2*5*337)
FQ1 in base 31 = 1QF in base 111 = 1FQ in base 116 (n=15222 = 2*3*43*59)
B74 in base 37 = 7B4 in base 46 = 47B in base 61 (n=15322 = 2*47*163)

Can You Dij It? #1

The most powerful drug in the world is water. The second most powerful is language. But everyone’s on them, so nobody realizes how powerful they are. Well, you could stop drinking water. Then you’d soon realize its hold on the body and the brain.

But you can’t stop using language. Try it. No, the best way to realize the power of language is to learn a new one. Each is a feast with different flavours. New alphabets are good too. The Devanagari alphabet is one of the strongest, but if you want it in refined form, try the phonetic alphabet. It will transform the way you see the world. That’s because it will make you conscious of what you’re already subconsciously aware of.

But “language” is a bigger category that it used to be. Nowadays we have computer languages too. Learning one is another way of transforming the way you see the world. And like natural languages – French, Georgian, Tagalog – they come in different flavours. Pascal is not like Basic is not like C is not like Prolog. But all of them seem to put you in touch with some deeper aspect of reality. Computer languages are like mathemagick: a way to give commands to something immaterial and alter the world by the application of will.

That feeling is at its strongest when you program with machine code, the raw instructions used by the electronics of a computer. At its most fundamental, machine code is simply a series of binary numbers controlling how a computer processes other binary numbers. You can memorize and use those code-numbers, but it’s easier to use something like assembly language, which makes machine-code friendlier for human beings. But it still looks very odd to the uninitiated:

setupnum:
xor ax,ax
xor bp,bp
mov cx,20
clearloop:
mov [di+bp],ax
add bp,2
loop clearloop
ret

That’s almost at the binary bedrock. And machine code is fast. If a fast higher-level language like C feels like flying a Messerschmitt 262, which was a jet-plane, machine-code feels like flying a Messerschmitt 163, which was a rocket-plane. A very fast and very dangerous rocket-plane.

I’m not good at programming languages, least of all machine code, but they are fun to use, quite apart from the way they make you feel as though you’re in touch with a deeper aspect of reality. They do that because the world is mathematics at its most fundamental level, I think, and computer languages are a form of mathematics.

Their mathematical nature is disguised in a lot of what they’re used for, but I like to use them for recreational mathematics. Machine-code is useful when you need a lot of power and speed. For example, look at these digits:

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

They’re what the Online Encyclopedia of Integer Sequences (OEIS) calls “the almost natural numbers” (sequence A007376) and you generate them by writing the standard integers – 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13… – and then separating each digit with a comma: 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 0, 1, 1, 1, 2, 1, 3… The commas give them some interesting twists. In a list of the standard integers, the 1st entry is 1, the 10th entry is 10, the 213rd entry is 213, the 987,009,381th entry is 987,009,381, and so on.

But that doesn’t work with the almost natural numbers. The 10th entry is 1, not 10, and the 11th entry is 0, not 11. But the 10th entry does begin the sequence (1, 0). I wondered whether that happened again. It does. The 63rd entry in the almost natural numbers begins the sequence (6, 3) – see the asterisks in the sequence above.

This happens again at the 3105th entry, which begins the sequence (3, 1, 0, 5). After that the gaps get bigger, which is where machine code comes in. An ordinary computer-language takes a long time to reach the 89,012,345,679th entry in the almost natural numbers. Machine code is much quicker, which is why I know that the 89,012,345,679th entry begins the sequence (8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 9):

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 63, 3105, 43108, 77781, 367573, 13859021, 77911127, 911360799, 35924813703, 74075186297, 89012345679…

And an ordinary computer-language might give you the impression that base 9 doesn’t have numbers like these (apart from the trivial 1, 2, 3, 4, 5, 6, 7, 8, 10…). But it does. 63 in base 10 is a low-hanging fruit: you could find it working by hand. In base 9, the fruit are much higher-hanging. But machine code plucks them with almost ridiculous ease:

1, 2, 3, 4, 5, 6, 7, 8, 10, 570086565, 655267526, 2615038272, 4581347024, 5307541865, 7273850617, 7801234568…

Playing the Double Base

Here’s some mathematical nonsense:

10 > 12
100 > 122
1000 > 1222

How can 1000 > 1222? Well, it makes perfect sense in what you might call a double base. In this base, every number is identified by a unique string of digits, but the strings don’t behave as they do in a standard base.

To see how this double base works, first look at 9 in standard base 2. To generate the binary digits from right to left, you follow the procedure x mod 2 and x = x div 2, where (x mod 2) returns the remainder when x is divided by 2 and (x div 2) divides x by 2 and discards the remainder:

9 mod 2 = 1 → ...1
9 div 2 = 4
4 mod 2 = 0 → ..01
4 div 2 = 2
2 mod 2 = 0 → .001
2 div 2 = 1
1 mod 2 = 1 → 1001

So 9[b=10] = 1001[b=2]. To adapt the procedure to base 3, simply use x mod 3 and x = x div 3:

32 mod 3 = 2 → ...2
32 div 3 = 10
10 mod 3 = 1 → ..12
10 div 3 = 3
3 mod 3 = 0 → .012
3 div 3 = 1
1 mod 3 = 1 → 1012

So 32[b=10] = 1012[b=3].

But what happens if you mix bases and use (x mod 3) and (x div 2), like this?:

2 mod 3 = 2 → .2
2 div 2 = 1
1 mod 3 = 1 → 12

3 mod 3 = 0 → .0
3 div 2 = 1
1 mod 3 = 1 → 10

So 10 > 12, i.e. 10[b=3,2] > 12[b=3,2].

5 mod 3 = 2 → ..2
5 div 2 = 2
2 mod 3 = 2 → .22
2 div 2 = 1
1 mod 3 = 1 → 122

6 mod 3 = 0 → ..0
6 div 2 = 3
3 mod 3 = 0 → .00
3 div 2 = 1
1 mod 3 = 1 → 100

So 100 > 122.

11 mod 3 = 2 → ...2
11 div 2 = 5
5 mod 3 = 2 → ..22
5 div 2 = 2
2 mod 3 = 2 → .222
2 div 2 = 1
1 mod 3 = 1 → 1222

12 mod 3 = 0 → …0
12 div 2 = 6
6 mod 3 = 0 → ..00
6 div 2 = 3
3 mod 3 = 0 → .000
3 div 2 = 1
1 mod 3 = 1 → 1000

And 1000 > 1222. Here are numbers 1 to 32 in this double base:

1 = 1
12 = 2
10 = 3
121 = 4
122 = 5
100 = 6
101 = 7
1212 = 8
1210 = 9
1221 = 10
1222 = 11
1000 = 12
1001 = 13
1012 = 14
1010 = 15
12121 = 16
12122 = 17
12100 = 18
12101 = 19
12212 = 20
12210 = 21
12221 = 22
12222 = 23
10000 = 24
10001 = 25
10012 = 26
10010 = 27
10121 = 28
10122 = 29
10100 = 30
10101 = 31
121212 = 32

Given a number represented in this mixed base, how do you extract the underlying n? Suppose the number takes the form n = (digit[1]..digit[di]), where digit[1] is the first and leftmost digit and digit[di] the final and rightmost digit. Then this algorithm will extract n:

n = 1
for i = 2 to di
..n = n * 2
..while n mod 3 ≠ digit[i]
....n = n + 1
..endwhile
next i
print n

For example, suppose n = 12212[b=3,2]. Then di = 5 and the algorithm will work like this:

n = 1
n = n * 2 = 2.
2 mod 3 = 2 = digit[2]
2 * 2 = 4
4 mod 3 = 1 ≠ digit[3]
5 mod 3 = 2 = digit[3]
5 * 2 = 10
10 mod 3 = 1 = digit[4]
10 * 2 = 20
20 mod 3 = 2 = digit[5]

Therefore 12212[b=3,2] = 20[b=10].

Now try some more mathematical nonsense:

21 > 100
111 > 1,000
1,001 > 10,000
10,001 > 100,000

How can numbers with d digits be greater than numbers with d+1 digits? Easily. In this incremental base, the base adjusts itself as the digits are generated, like this:

5 mod 2 = 1 → .1
5 div 2 = 2
2 mod (2 + 1) = 2 mod 3 = 2 → 21

The first digit generated is 1, so the base increases to (2 + 1) = 3 for the second digit. Compare the procedure when n = 4:

4 mod 2 = 0 → ..0
4 div 2 = 2
2 mod 2 = 0 → .00
2 div 2 = 1
1 mod 2 = 1 → 100

So 21 > 100, because 4 is a power of 2 and all the digits generated by (x mod 2) are 0 except the final and leftmost. 2 + 0 = 2. Now try n = 33:

33 mod 2 = 1 → ...1
33 div 2 = 16
16 mod (2+1) = 16 mod 3 = 1 → ..11
16 div 3 = 5
5 mod (3+1) = 5 mod 4 = 1 → .111
5 div 4 = 1
1 mod (4+1) = 1 mod 5 = 1.

33[b=10] = 1111[b=2,3,4,5].

Here are numbers 1 to 60 in this incremental base (note how 21 > 100, 111 > 1000, 1001 > 10000 and 10001 > 100000):

1 = 1
10 = 2
11 = 3
100 = 4*
21 = 5*
110 = 6
101 = 7
1000 = 8*
111 = 9*
210 = 10
121 = 11
1100 = 12
201 = 13
1010 = 14
211 = 15
10000 = 16*
221 = 17
1110 = 18
1001 = 19*
2100 = 20
311 = 21
1210 = 22
321 = 23
11000 = 24
1101 = 25
2010 = 26
1011 = 27
10100 = 28
421 = 29
2110 = 30
1201 = 31
100000 = 32*
1111 = 33
2210 = 34
1021 = 35
11100 = 36
2001 = 37
10010 = 38
1211 = 39
21000 = 40
1121 = 41
3110 = 42
2101 = 43
12100 = 44
1311 = 45
3210 = 46
1221 = 47
110000 = 48
2201 = 49
11010 = 50
2011 = 51
20100 = 52
1321 = 53
10110 = 54
10001 = 55*
101000 = 56
2111 = 57
4210 = 58
1421 = 59
21100 = 60

And here are numbers 256 to 270 (Note how 8,421 > 202,100 > 100,000,000):

100000000 = 256*
11221 = 257
101110 = 258
32101 = 259
202100 = 260*
13311 = 261
41210 = 262
10321 = 263
1111000 = 264
24201 = 265
131010 = 266
23011 = 267
320100 = 268
8421 = 269*
52110 = 270

Extracting n from a number represented in this incremental base is trickier than for the double base using (x mod 3) and (x div 2). To see how to do it, examine 11221[b=incremental]. The fifth and rightmost digit is 1, so the base increases to (2 + 1) = 3 for the fourth digit, which is 2. The base increases to (3 + 2) = 5 for the third digit, which is 2 again. The base increases to (5 + 2) = 7 for the second digit, 1. But the first and rightmost digit, 1, represents (x div 7) mod (7 + 1 = 8). So n can be extracted like this:

digit[1] * 7 = 1 * 7 = 7
7 mod 7 = 0 ≠ digit[2]
8 mod 7 = 1 = digit[2]
8 * 5 = 40
40 mod 5 = 0 ≠ digit[3]
41 mod 5 = 1 ≠ digit[3]
42 mod 5 = 2 = digit[3]
42 * 3 = 126
126 mod 3 = 0 ≠ digit[4]
127 mod 3 = 1 ≠ digit[4]
128 mod 3 = 2 = digit[4]
128 * 2 = 256
256 mod 2 = 0 ≠ digit[5]
257 mod 2 = 1 = digit[5]

So 11221[b=8,7,5,3,2] = 257[b=10].

Now try 8421[b=incremental]. The fourth and rightmost digit is 1, so the base increases to (2 + 1) = 3 for the third digit, which is 2. The base increases to (3 + 2) = 5 for the second digit, 4. But the first and rightmost digit, 8, represents (x div 5) mod (5 + 4 = 9). So n can be extracted like this:

digit[1] * 5 = 8 * 5 = 40
40 mod 5 = 0 ≠ digit[2]
41 mod 5 = 1 ≠ digit[2]
42 mod 5 = 2 ≠ digit[2]
43 mod 5 = 3 ≠ digit[2]
44 mod 5 = 4 = digit[2]
44 * 3 = 132
132 mod 3 = 0 ≠ digit[3]
133 mod 3 = 1 ≠ digit[3]
134 mod 3 = 2 = digit[3]
134 * 2 = 268
268 mod 2 = 0 ≠ digit[4]
269 mod 2 = 1 = digit[4]

So 8421[b=9,5,3,2] = 269[b=10].

Narcischism

What have bits to do with splits? A lot. Suppose you take the digits 12345, split them in all possible ways, then sum the results, like this:

12345 → (1234 + 5) + (123 + 45) + (123 + 4 + 5) + (12 + 345) + (12 + 34 + 5) + (12 + 3 + 45) + (12 + 3 + 4 + 5) + (1 + 2345) + (1 + 234 + 5) + (1 + 23 + 45) + (1 + 23 + 4 + 5) + (1 + 2 + 345) + (1 + 2 + 34 + 5) + (1 + 2 + 3 + 45) + (1 + 2 + 3 + 4 + 5) = 5175.

That’s a sum in base 10, but base 2 is at work below the surface, because each set of numbers is the answer to a series of binary questions: split or not? There are four possible places to split the digits 12345: after the 1, after the 2, after the 3 and after the 4. In (1 + 2 + 3 + 4 + 5), the binary question “Split or not?” is answered SPLIT every time. In (1234 + 5) and (1 + 2345) it’s answered SPLIT only once.

So the splits are governed by a four-digit binary number ranging from 0001 to 1111. When the binary digit is 1, split; when the binary digit is 0, don’t split. In binary, 0001 to 1111 = 01 to 15 in base 10 = 2^4-1. That’s for a five-digit number, so the four-digit 1234 will have 2^3-1 = 7 sets of sums:

1234 → (123 + 4) + (12 + 34) + (12 + 3 + 4) + (1 + 234) + (1 + 23 + 4) + 110 (1 + 2 + 34) + (1 + 2 + 3 + 4) = 502.

And the six-digit number 123456 will have 2^5-1 = 31 sets of sums. By now, an exciting question may have occurred to some readers. Does any number in base 10 equal the sum of all possible numbers formed by splitting its digits?

The exciting answer is: 0. In other words: No. To see why not, examine a quick way of summing the split-bits of 123,456,789, with nine digits. The long way is to find all possible sets of split-bits. There are 2^8-1 = 255 of them. The quick way is to sum these equations:

1 * 128 + 10 * 64 + 100 * 32 + 1000 * 16 + 10000 * 8 + 100000 * 4 + 1000000 * 2 + 10000000 * 1
2 * 128 + 20 * 64 + 200 * 32 + 2000 * 16 + 20000 * 8 + 200000 * 4 + 2000000 * 2 + 20000000 * 1
3 * 128 + 30 * 64 + 300 * 32 + 3000 * 16 + 30000 * 8 + 300000 * 4 + 3000000 * 3
4 * 128 + 40 * 64 + 400 * 32 + 4000 * 16 + 40000 * 8 + 400000 * 7
5 * 128 + 50 * 64 + 500 * 32 + 5000 * 16 + 50000 * 15
6 * 128 + 60 * 64 + 600 * 32 + 6000 * 31
7 * 128 + 70 * 64 + 700 * 63
8 * 128 + 80 * 127
9 * 255

Sum = 52,322,283.

52,322,283 has eight digits. If you use the same formula for the nine-digit number 999,999,999, the sum is 265,621,761, which has nine digits but is far smaller than 999,999,999. If you adapt the formula for the twenty-digit 19,999,999,999,999,999,999 (starting with 1), the split-bit sum is 16,562,499,999,987,400,705. In base 10, as far as I can see, numbers increase too fast and digit-lengths too slowly for the binary governing the split-sums to keep up. That’s also true in base 9 and base 8:

Num = 18,888,888,888,888,888,888 (b=9)
Sum = 16,714,201,578,038,328,760

Num = 17,777,777,777,777,777,777 (b=8)
Sum = 17,070,707,070,625,000,001

So what about base 7? Do the numbers increase slowly enough and the digit-lengths fast enough for the binary to keep up? The answer is: 1. In base 7, this twenty-digit number is actually smaller than its split-bit sum:

Num = 16,666,666,666,666,666,666 (b=7)
Sum = 20,363,036,303,404,141,363

And if you search below that, you can find a number that is equal to its split-bit sum:

166512 → (1 + 6 + 6 + 5 + 1 + 2) + (16 + 6 + 5 + 1 + 2) + (1 + 66 + 5 + 1 + 2) + (166 + 5 + 1 + 2) + (1 + 6 + 65 + 1 + 2) + (16 + 65 + 1 + 2) + (1 + 665 + 1 + 2) + (1665 + 1 + 2) + (1 + 6 + 6 + 51 + 2) + (16 + 6 + 51 + 2) + (1 + 66 + 51 + 2) + (166 + 51 + 2) + (1 + 6 + 651 + 2) + (16 + 651 + 2) + (1 + 6651 + 2) + (16651 + 2) + (1 + 6 + 6 + 5 + 12) + (16 + 6 + 5 + 12) + (1 + 66 + 5 + 12) + (166 + 5 + 12) + (1 + 6 + 65 + 12) + (16 + 65 + 12) + (1 + 665 + 12) + (1665 + 12) + (1 + 6 + 6 + 512) + (16 + 6 + 512) + (1 + 66 + 512) + (166 + 512) + (1 + 6 + 6512) + (16 + 6512) + (1 + 66512) = 166512[b=7] = 33525[b=10].

So 33525 in base 7 is what might be called a narcischist: it can gaze into the split-bits of its own digits and see itself gazing back. In base 6, 1940 is a narcischist:

12552 → (1 + 2 + 5 + 5 + 2) + (12 + 5 + 5 + 2) + (1 + 25 + 5 + 2) + (125 + 5 + 2) + (1 + 2 + 55 + 2) + (12 + 55 + 2) + (1 + 255 + 2) + (1255 + 2) + (1 + 2 + 5+ 52) + (12 + 5 + 52) + (1 + 25 + 52) + (125 + 52) + (1 + 2 + 552) + (12 + 552) + (1 + 2552) = 12552[b=6] = 1940[b=10].

In base 5, 4074 is a narcischist:

112244 → (1 + 1 + 2 + 2 + 4 + 4) + (11 + 2 + 2 + 4 + 4) + (1 + 12 + 2 + 4 + 4) + (112 + 2 + 4 + 4) + (1 + 1 + 22 + 4 + 4) + (11 + 22 + 4 + 4) + (1 + 122 + 4 + 4) + (1122 + 4 + 4) + (1 + 1 + 2 + 24 + 4) + (11 + 2 + 24 + 4) + (1 + 12 + 24 + 4) + (112 + 24 + 4) + (1 + 1 + 224 + 4) + (11 + 224 + 4) + (1 + 1224 + 4) + (11224 + 4) + (1 + 1 + 2 + 2 + 44) + (11 + 2 + 2 + 44) + (1 + 12 + 2 + 44) + (112 + 2 + 44) + (1 + 1 + 22 + 44) + (11 + 22 + 44) + (1 + 122 + 44) + (1122 + 44) + (1 + 1 + 2 + 244) + (11 + 2 + 244) + (1 + 12 + 244) + (112 + 244) + (1 + 1 + 2244) + (11 + 2244) + (1 + 12244) = 112244[b=5] = 4074.

And in base 4, 27 is:

123 → (1 + 2 + 3) + (12 + 3) + (1 + 23) = 123[b=4] = 27.

And in base 3, 13 and 26 are:

111 → (1 + 1 + 1) + (11 + 1) + (1 + 11) = 111[b=3] = 13.

222 → (2 + 2 + 2) + (22 + 2) + (2 + 22) = 222[b=3] = 26.

There are many more narcischists in all these bases, even if you exclude numbers with zeroes in them, like these in base 4:

1022 → (1 + 0 + 2 + 2) + (10 + 2 + 2) + (1 + 02 + 2) + (102 + 2) + (1 + 0 + 22) + (10 + 22) + (1 + 022) = 1022[b=4] = 74.

1030 → (1 + 0 + 3 + 0) + (10 + 3 + 0) + (1 + 03 + 0) + (103 + 0) + (1 + 0 + 30) + (10 + 30) + (1 + 030) = 1030[b=4] = 76.

1120 → (1 + 1 + 2 + 0) + (11 + 2 + 0) + (1 + 12 + 0) + (112 + 0) + (1 + 1 + 20) + (11 + 20) + (1 + 120) = 1120[b=4] = 88.

Dig Sum Fib

The Fibonacci sequence is an infinitely rich sequence based on a very simple rule: add the previous two numbers. If the first two numbers are 1 and 1, the sequence begins like this:

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…

Plainly, the numbers increase for ever. The hundredth Fibonacci number is 354,224,848,179,261,915,075, for example, and the two-hundredth is 280,571,172,992,510,140,037,611,932,413,038,677,189,525. But there are variants on the Fibonacci sequence that don’t increase for ever. The standard rule is n(i) = n(i-2) + n(i-1). What if the rule becomes n(i) = digitsum(n(i-2)) + digitsum(n(i-1))? Now the sequence falls into a loop, like this:

1, 1, 2, 3, 5, 8, 13, 12, 7, 10, 8, 9, 17, 17, 16, 15, 13, 10, 5, 6, 11, 8, 10, 9, 10, 10, 2, 3… (length=28)

But that’s in base 10. Here are the previous bases:

1, 1, 2, 2, 2… (base=2) (length=5)
1, 1, 2, 3, 3, 2, 3… (b=3) (l=7)
1, 1, 2, 3, 5, 5, 4, 3, 4, 4, 2, 3… (b=4) (l=12)
1, 1, 2, 3, 5, 4, 5, 5, 2, 3… (b=5) (l=10)
1, 1, 2, 3, 5, 8, 8, 6, 4, 5, 9, 9, 8, 7, 5, 7, 7, 4, 6, 5, 6, 6, 2, 3… (b=6) (l=24)
1, 1, 2, 3, 5, 8, 7, 3, 4, 7, 5, 6, 11, 11, 10, 9, 7, 4, 5, 9, 8, 5, 7, 6, 7, 7, 2, 3… (b=7) (l=28)
1, 1, 2, 3, 5, 8, 6, 7, 13, 13, 12, 11, 9, 6, 8, 7, 8, 8, 2, 3… (b=8) (l=20)
1, 1, 2, 3, 5, 8, 13, 13, 10, 7, 9, 8, 9, 9, 2, 3… (b=9) (l=16)

Apart from base 2, all the bases repeat with (2, 3), which is set up in each case by (base, base) = (10, 10) in that base, equivalent to (1, 1). All bases > 2 appear to repeat with (2, 3), but I don’t understand why. The length of the sequence varies widely. Here it is in bases 29, 30 and 31:

1, 1, 2, 3, 5, 8, 13, 21, 34, 27, 33, 32, 9, 13, 22, 35, 29, 8, 9, 17, 26, 43, 41, 28, 41, 41, 26, 39, 37, 20, 29, 21, 22, 43, 37, 24, 33, 29, 6, 7, 13, 20, 33, 25, 30, 27, 29, 28, 29, 29, 2, 3… (b=29) (l=52)

1, 1, 2, 3, 5, 8, 13, 21, 34, 26, 31, 28, 30, 29, 30, 30, 2, 3 (b=30) (l=18)

1, 1, 2, 3, 5, 8, 13, 21, 34, 25, 29, 54, 53, 47, 40, 27, 37, 34, 11, 15, 26, 41, 37, 18, 25, 43, 38, 21, 29, 50, 49, 39, 28, 37, 35, 12, 17, 29, 46, 45, 31, 16, 17, 33, 20, 23, 43, 36, 19, 25, 44, 39, 23, 32, 25, 27, 52, 49, 41, 30, 41, 41, 22, 33, 25, 28, 53, 51, 44, 35, 19, 24, 43, 37, 20, 27, 47, 44, 31, 15, 16, 31, 17, 18, 35, 23, 28, 51, 49, 40, 29, 39, 38, 17, 25, 42, 37, 19, 26, 45, 41, 26, 37, 33, 10, 13, 23, 36, 29, 35, 34, 9, 13, 22, 35, 27, 32, 29, 31, 30, 31, 31, 2, 3 (b=31) (l=124)

The sequence for base 77 is short like that for base 30:

1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 68, 81, 73, 78, 75, 77, 76, 77, 77, 2, 3 (b=77) (l=22)

But the sequence for base 51 is this:

1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 39, 44, 83, 77, 60, 37, 47, 84, 81, 65, 46, 61, 57, 18, 25, 43, 68, 61, 29, 40, 69, 59, 28, 37, 65, 52, 17, 19, 36, 55, 41, 46, 87, 83, 70, 53, 23, 26, 49, 75, 74, 49, 73, 72, 45, 67, 62, 29, 41, 70, 61, 31, 42, 73, 65, 38, 53, 41, 44, 85, 79, 64, 43, 57, 50, 57, 57, 14, 21, 35, 56, 41, 47, 88, 85, 73, 58, 31, 39, 70, 59, 29, 38, 67, 55, 22, 27, 49, 76, 75, 51, 26, 27, 53, 30, 33, 63, 46, 59, 55, 14, 19, 33, 52, 35, 37, 72, 59, 31, 40, 71, 61, 32, 43, 75, 68, 43, 61, 54, 15, 19, 34, 53, 37, 40, 77, 67, 44, 61, 55, 16, 21, 37, 58, 45, 53, 48, 51, 49, 50, 99, 99, 98, 97, 95, 92, 87, 79, 66, 45, 61, 56, 17, 23, 40, 63, 53, 16, 19, 35, 54, 39, 43, 82, 75, 57, 32, 39, 71, 60, 31, 41, 72, 63, 35, 48, 83, 81, 64, 45, 59, 54, 13, 17, 30, 47, 77, 74, 51, 25, 26, 51, 27, 28, 55, 33, 38, 71, 59, 30, 39, 69, 58, 27, 35, 62, 47, 59, 56, 15, 21, 36, 57, 43, 50, 93, 93, 86, 79, 65, 44, 59, 53, 12, 15, 27, 42, 69, 61, 30, 41, 71, 62, 33, 45, 78, 73, 51, 24, 25, 49, 74, 73, 47, 70, 67, 37, 54, 41, 45, 86, 81, 67, 48, 65, 63, 28, 41, 69, 60, 29, 39, 68, 57, 25, 32, 57, 39, 46, 85, 81, 66, 47, 63, 60, 23, 33, 56, 39, 45, 84, 79, 63, 42, 55, 47, 52, 49, 51, 50, 51, 51, 2, 3… (b=51) (l=304)

Pair on a D-String

What’s special about the binary number 10011 and the ternary number 1001120221? To answer the question, you have to see double. 10011 contains all possible pairs of numbers created from 0 and 1, just as 1001120221 contains all possible pairs created from 0, 1 and 2. And each pair appears exactly once. Now try the quaternary number 10011202130322331. That contains exactly one example of all possible pairs created from 0, 1, 2 and 3.

But there’s something more: in each case, the number is the smallest possible number with that property. As the bases get higher, that gets less obvious. In quinary, or base 5, the smallest number containing all possible pairs is 10011202130314042232433441. The digits look increasingly random. And what about base 10? There are 100 possible pairs of numbers created from the digits 0 to 9, starting with 00, 01, 02… and ending with …97, 98, 99. To accommodate 100 pairs, the all-pair number in base 10 has to be 101 digits long. It’s a string of digits, so let’s call it a d-string:

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

Again, the digits look increasingly random. They aren’t: they’re strictly determined. The d-string is in harmony. As the digits are generated from the left, they impose restrictions on the digits that appear later. It might appear that you could shift larger digits to the right and make the number smaller, but if you do that you no longer meet the conditions and the d-string collapses into dischord.

Now examine d-strings containing all possible triplets created from the digits of bases 2, 3 and 4:

1, 0, 0, 0, 1, 0, 1, 1, 1, 0 in base 2 = 558 in base 10

1, 0, 0, 0, 1, 0, 1, 1, 0, 2, 0, 0, 2, 1, 1, 1, 2, 0, 1, 2, 1, 2, 2, 0, 2, 2, 2, 1, 0 in base 3 = 23203495920756 in base 10

1, 0, 0, 0, 1, 0, 1, 1, 0, 2, 0, 0, 2, 1, 0, 3, 0, 0, 3, 1, 1, 1, 2, 0, 1, 2, 1, 1, 3, 0, 1, 3, 1, 2, 2, 0, 2, 2, 1, 2, 3, 0, 2, 3, 1, 3, 2, 0, 3, 2, 1, 3, 3, 0, 3, 3, 2, 2, 2, 3, 2, 3, 3, 3, 1, 0 in base 4 = 1366872334420014346556556812432766057460 in base 10

Note that there are 8 possible triplets in base 2, so the all-triplet number has to be 10 digits long. In base 10, there are 1000 possible triplets, so the all-triplet number has to be 1002 digits long. Here it is:

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

Consider the quadruplet number in base 10. There are 10000 possible quadruplets, so the all-quadruplet number is 10003 digits long. And so on. In general, the “all n-tuplet” number in base b contains b^n n-tuplets and is (b^n + n-1) digits long. If b = 10 and n = 4, the d-string starts like this:

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

What about when n = 100? Now the d-string is ungraspably huge – too big to fit in the known universe. But it starts with 1 followed by a hundred 0s and every digit after that is entirely determined. Perhaps there’s a simple way to calculate any given digit, given its position in the d-string. Either way, what is the ontological status of the d-string for n=100? Does it exist in some Platonic realm of number, independent of physical reality?

Some would say that it does, just like √2 or π or e. I disagree. I don’t believe in a Platonic realm. If the universe or multiverse ceased to exist, numbers and mathematics in general would also cease to exist. But this isn’t to say that mathematics depends on physical reality. It doesn’t. Nor does physical reality depend on mathematics. Rather, physical reality necessarily embodies mathematics, which might be defined as “entity in interrelation”. Humans have invented small-m mathematics, a symbolic way of expressing the physical embodiment of big-m mathematics.

But small-m mathematics is actually more powerful and far-ranging, because it increases the number, range and power of entities and their interaction. Where are √2 and π in physical reality? Nowhere. You could say that early mathematicians saw their shadows, cast from a Platonic realm, and deduced their existence in that realm, but that’s a metaphor. Do all events, like avalanches or thunderstorms, exist in some Platonic realm before they are realized? No, they arise as physical entities interact according to laws of physics. In a more abstract way, √2 and π arise as entities of another kind interact according to laws of logic: the concepts of a square and its diagonal, of a circle and its diameter.

The d-strings discussed above arise from the interaction of simpler concepts: the finite set of digits in a base and the ways in which they can be combined. Platonism is unnecessary: the arc and spray of a fountain are explained by the pressure of the water, the design of the pipes, the arrangement of the nozzles, not by reference to an eternal archetype of water and spray. In small-m mathematics, there are an infinite number of fountains, because small-m mathematics opens a door to a big-U universe, infinitely larger and richer than the small-u universe of physical reality.

Poulet’s Propeller

The Penguin Dictionary of Curious and Interesting Numbers (1986) is one of my favourite books. It’s a fascinating mixture of math, mathecdote and math-joke:

2·618 0333…

The square of φ, the golden ratio, and the only positive number such that √n = n-1. (pg. 45)


6

Kepler discussed the 6-fold symmetry of snowflakes, and attempted to explain it by considering the close packing of spheres in a hexagonal array. (pg. 69)


39

This appears to be the first uninteresting number, which of course makes it an especially interesting number, because it is the smallest number to have the property of being uninteresting.

It is therefore also the first number to be simultaneously interesting and uninteresting. (pg. 120)

David Wells, who wrote the Dictionary, “had the rare distinction of being a Cambridge scholar in mathematics and failing his degree”. He must be the mathematical equivalent of the astronomer Patrick Moore: a popularizer responsible for opening many minds and inspiring many careers. He’s also written books on geometry and mathematical puzzles. But not everyone appreciates his efforts. This is a sideswipe in a review of William Hartston’s The Book of Numbers:

Thankfully, this book is more concerned with facts than mathematics. Anyone wanting to learn more about [π] or the Fibonacci sequence should turn to the Penguin Dictionary of Curious and Interesting Numbers, a volume which none but propeller-heads will find either curious or interesting. (Review in The Independent, 18th December 1997)


Continue reading: Poulet’s Propeller