Zequality Now

Here are the numbers one to eight in base 2:

1, 10, 11, 100, 101, 110, 111, 1000…

Now see what happens when you count the zeroes:


1, 10[1], 11, 10[2]0[3], 10[4]1, 110[5], 111, 10[6]0[7]0[8]...

In base 2, the numbers one to eight contain exactly eight zeroes, that is, zerocount(1..8,b=2) = 8. But it doesn’t work out so exactly in base 3:


1, 2, 10[1], 11, 12, 20[2], 21, 22, 10[3]0[4], 10[5]1, 10[6]2, 110[7], 111, 112, 120[8], 121, 122, 20[9]0[10], 20[11]1, 20[12]2, 210[13], 211, 212, 220[14], 221, 222, 10[15]0[16]0[17], 10[18]0[19]1, 10[20]0[21]2, 10[22]10[23], 10[24]11, 10[25]12, 10[26]20[27], 10[28]21, 10[29]22, 110[30]0[31], 110[32]1, 110[33]2, 1110[34], 1111, 1112, 1120[35], 1121, 1122, 120[36]0[37], 120[38]1, 120[39]2, 1210[40], 1211, 1212, 1220[41], 1221, 1222, 20[42]0[43]0[44], 20[45]0[46]1, 20[47]0[48]2, 20[49]10[50], 20[51]11, 20[52]12, 20[53]20[54], 20[55]21, 20[56]22, 210[57]0[58], 210[59]1, 210[60]2, 2110[61], 2111, 2112, 2120[62], 2121, 2122, 220[63]0[64], 220[65]1, 220[66]2, 2210[67], 2211, 2212, 2220[68], 2221, 2222, 10[69]0[70]0[71]0[72], 10[73]0[74]0[75]1, 10[76]0[77]0[78]2, 10[79]0[80]10[81], 10[82]0[83]11, 10[84]0[85]12, 10[86]0[87]20[88]...

In base 3, 10020 = 87 and zerocount(1..87,b=3) = 88. And what about base 4? zerocount(1..1068,b=4) = 1069 (n=100,230 in base 4). After that, zerocount(1..16022,b=5) = 16023 (n=1,003,043 in base 5) and zerocount(1..284704,b=6) = 284,705 (n=10,034,024 in base 6).

The numbers are getting bigger fast and it’s becoming increasingly impractible to count the zeroes individually. What you need is an algorithm that will take any given n and work out how many zeroes are required to write the numbers 1 to n. The simplest way to do this is to work out how many times 0 has appeared in each position of the number. The 1s position is easy: you simply divide the number by the base and discard the remainder. For example, in base 10, take the number 25. The 0 must have appeared in the 1s position twice, for 10 and 20, so zerocount(1..25) = 25 \ 10 = 2. In 2017, the 0 must have appeared in the 1s position 201 times = 2017 \ 10. And so on.

It gets a little trickier for the higher positions, the 10s, 100s, 1000s and so on, but the same basic principle applies. And so you can easily create an algorithm that takes a number, n, and produces zerocount(1..n) in a particular base. With this algorithm, you can quickly find zerocount(1..n) >= n in higher bases:


zerocount(1..1000,b=2) = 1,000 (n=8)*
zerocount(1..10020,b=3) = 10,021 (n=87)
zerocount(1..100230,b=4) = 100,231 (n=1,068)
zerocount(1..1003042,b=5) = 1,003,043 (n=16,022)
zerocount(1..10034024,b=6) = 10,034,025 (n=284,704)
zerocount(1..100405550,b=7) = 100,405,551 (n=5,834,024)
zerocount(1..1004500236,b=8) = 1,004,500,237 (n=135,430,302)
zerocount(1..10050705366,b=9) = 10,050,705,367 (n=3,511,116,537)
zerocount(1..100559404366,b=10) = 100,559,404,367
zerocount(1..1006083A68919,b=11) = 1,006,083,A68,919 (n=3,152,738,985,031)*
zerocount(1..10066AA1430568,b=12) = 10,066,AA1,430,569 (n=107,400,330,425,888)
zerocount(1..1007098A8719B81,b=13) = 100,709,8A8,719,B81 (n=3,950,024,143,546,664)*
zerocount(1..10077C39805D81C7,b=14) = 1,007,7C3,980,5D8,1C8 (n=155,996,847,068,247,395)
zerocount(1..10080B0034AA5D16D,b=15) = 10,080,B00,34A,A5D,171 (n=6,584,073,072,068,125,453)
zerocount(1..10088DBE29597A6C77,b=16) = 100,88D,BE2,959,7A6,C77 (n=295,764,262,988,176,583,799)*
zerocount(1..10090C5309AG72CBB3F,b=17) = 1,009,0C5,309,AG7,2CB,B3G (n=14,088,968,131,538,370,019,982)
zerocount(1..10099F39070FC73C1G73,b=18) = 10,099,F39,070,FC7,3C1,G75 (n=709,394,716,006,812,244,474,473)
zerocount(1..100A0DC1258614CA334EB,b=19) = 100,A0D,C12,586,14C,A33,4EC (n=37,644,984,315,968,494,382,106,708)
zerocount(1..100AAGDEEB536IBHE87006,b=20) = 1,00A,AGD,EEB,536,IBH,E87,008 (n=2,099,915,447,874,594,268,014,136,006)

And you can also easily find the zequal numbers, that is, the numbers n for which, in some base, zerocount(1..n) exactly equals n:


zerocount(1..1000,b=2) = 1,000 (n=8)
zerocount(1..1006083A68919,b=11) = 1,006,083,A68,919 (n=3,152,738,985,031)
zerocount(1..1007098A8719B81,b=13) = 100,709,8A8,719,B81 (n=3,950,024,143,546,664)
zerocount(1..10088DBE29597A6C77,b=16) = 100,88D,BE2,959,7A6,C77 (n=295,764,262,988,176,583,799)
zerocount(1..100CCJFFAD4MI409MI0798CJB3,b=24) = 10,0CC,JFF,AD4,MI4,09M,I07,98C,JB3 (n=32,038,681,563,209,056,709,427,351,442,469,835)
zerocount(1..100DDL38CIO4P9K0AJ7HK74EMI7L,b=26) = 1,00D,DL3,8CI,O4P,9K0,AJ7,HK7,4EM,I7L (n=160,182,333,966,853,031,081,693,091,544,779,177,187)
zerocount(1..100EEMHG6OE8EQKO0BF17LCCIA7GPE,b=28) = 100,EEM,HG6,OE8,EQK,O0B,F17,LCC,IA7,GPE (n=928,688,890,453,756,699,447,122,559,347,771,300,777,482)
zerocount(1..100F0K7MQO6K9R1S616IEEL2JRI73PF,b=29) = 1,00F,0K7,MQO,6K9,R1S,616,IEE,L2J,RI7,3PF (n=74,508,769,042,363,852,559,476,397,161,338,769,391,145,562)
zerocount(1..100G0LIL0OQLF2O0KIFTK1Q4DC24HL7BR,b=31) = 100,G0L,IL0,OQL,F2O,0KI,FTK,1Q4,DC2,4HL,7BR (n=529,428,987,529,739,460,369,842,168,744,635,422,842,585,510,266)
zerocount(1..100H0MUTQU3A0I5005WL2PD7T1ASW7IV7NE,b=33) = 10,0H0,MUT,QU3,A0I,500,5WL,2PD,7T1,ASW,7IV,7NE (n=4,262,649,311,868,962,034,947,877,223,846,561,239,424,294,726,563,632)
zerocount(1..100HHR387RQHK9OP6EDBJEUDAK35N7MN96LB,b=34) = 100,HHR,387,RQH,K9O,P6E,DBJ,EUD,AK3,5N7,MN9,6LB (n=399,903,937,958,473,433,782,862,763,628,747,974,628,490,691,628,136,485)
zerocount(1..100IISLI0CYX2893G9E8T4I7JHKTV41U0BKRHT,b=36) = 10,0II,SLI,0CY,X28,93G,9E8,T4I,7JH,KTV,41U,0BK,RHT (n=3,831,465,379,323,568,772,890,827,210,355,149,992,132,716,389,119,437,755,185)
zerocount(1..100LLX383BPWE[40]ZL0G1M[40]1OX[39]67KOPUD5C[40]RGQ5S6W9[36],b=42) = 10,0LL,X38,3BP,WE[40],ZL0,G1M,[40]1O,X[39]6,7KO,PUD,5C[40],RGQ,5S6,W9[36] (n=6,307,330,799,917,244,669,565,360,008,241,590,852,337,124,982,231,464,556,869,653,913,711,854)
zerocount(1..100MMYPJ[38]14KDV[37]OG[39]4[42]X75BE[39][39]4[43]CK[39]K36H[41]M[37][43]5HIWNJ,b=44) = 1,00M,MYP,J[38]1,4KD,V[37]O,G[39]4,[42]X7,5BE,[39][39]4,[43]CK,[39]K3,6H[41],M[37][43],5HI,WNJ (n=90,257,901,046,284,988,692,468,444,260,851,559,856,553,889,199,511,017,124,021,440,877,333,751,943)
zerocount(1..100NN[36]3813[38][37]16F6MWV[41]UBNF5FQ48N0JRN[40]E76ZOHUNX2[42]3[43],b=46) = 100,NN[36],381,3[38][37],16F,6MW,V[41]U,BNF,5FQ,48N,0JR,N[40]E,76Z,OHU,NX2,[42]3[43] (n=1,411,636,908,622,223,745,851,790,772,948,051,467,006,489,552,352,013,745,000,752,115,904,961,213,172,605)
zerocount(1..100O0WBZO9PU6O29TM8Y0QE3I[37][39]A7E4YN[44][42]70[44]I[46]Z[45][37]Q2WYI6,b=47) = 1,00O,0WB,ZO9,PU6,O29,TM8,Y0Q,E3I,[37][39]A,7E4,YN[44],[42]70,[44]I[46],Z[45][37],Q2W,YI6 (n=182,304,598,281,321,725,937,412,348,242,305,189,665,300,088,639,063,301,010,710,450,793,661,266,208,306,996)
zerocount(1..100PP[39]37[49]NIYMN[43]YFE[44]TDTJ00EAEIP0BIDFAK[46][36]V6V[45]M[42]1M[46]SSZ[40],b=50) = 1,00P,P[39]3,7[49]N,IYM,N[43]Y,FE[44],TDT,J00,EAE,IP0,BID,FAK,[46][36]V,6V[45],M[42]1,M[46]S,SZ[40] (n=444,179,859,561,011,965,929,496,863,186,893,220,413,478,345,535,397,637,990,204,496,296,663,272,376,585,291,071,790)
zerocount(1..100Q0Y[46][44]K[49]CKG[45]A[47]Z[43]SPZKGVRN[37]2[41]ZPP[36]I[49][37]EZ[38]C[44]E[46]00CG[38][40][48]ROV,b=51) = 10,0Q0,Y[46][44],K[49]C,KG[45],A[47]Z,[43]SP,ZKG,VRN,[37]2[41],ZPP,[36]I[49],[37]EZ,[38]C[44],E[46]0,0CG,[38][40][48],ROV (n=62,191,970,278,446,971,531,566,522,791,454,395,351,613,891,150,548,291,266,262,575,754,206,359,828,753,062,692,619,547)
zerocount(1..100QQ[40]TL[39]ZA[49][41]J[41]7Q[46]4[41]66A1E6QHHTM9[44]8Z892FRUL6V[46]1[38][41]C[40][45]KB[39],b=52) = 100,QQ[40],TL[39],ZA[49],41]J[41],7Q[46],4[41]6,6A1,E6Q,HHT,M9[44],8Z8,92F,RUL,6V[46],1[38][41],C[40][45],KB[39] (n=8,876,854,501,927,007,077,802,489,292,131,402,136,556,544,697,945,824,257,389,527,114,587,644,068,732,794,430,403,381,731)
zerocount(1..100S0[37]V[53]Y6G[51]5J[42][38]X[40]XO[38]NSZ[42]XUD[47]1XVKS[52]R[39]JAHH[49][39][50][54]5PBU[42]H3[45][46]DEJ,b=55) = 100,S0[37],V[53]Y,6G[51],5J[42],[38]X[40],XO[38],NSZ,[42]XU,D[47]1,XVK,S[52]R,[39]JA,HH[49],[39][50][54],5PB,U[42]H,3[45][46],DEJ (n=28,865,808,580,366,629,824,612,818,017,012,809,163,332,327,132,687,722,294,521,718,120,736,868,268,650,080,765,802,786,141,387,114)

Autonomata

“Describe yourself.” You can say it to people. And you can say it to numbers too. For example, here’s the number 3412 describing the positions of its own digits, starting at 1 and working upward:


3412 – the 1 is in the 3rd position, the 2 is in the 4th position, the 3 is in the 1st position, and the 4 is in the 2nd position.

In other words, the positions of the digits 1 to 4 of 3412 recreate its own digits:


3412 → (3,4,1,2) → 3412

The number 3412 describes itself – it’s autonomatic (from Greek auto, “self” + onoma, “name”). So are these numbers:


1
21
132
2143
52341
215634
7243651
68573142
321654798

More precisely, they’re panautonomatic numbers, because they describe the positions of all their own digits (Greek pan or panto, “all”). But what if you use the positions of only, say, the 1s or the 3s in a number? In base ten, only one number describes itself like that: 1. But we’re not confined to base 10. In base 2, the positions of the 1s in 110 (= 6) are 1 and 10 (= 2). So 110 is monautonomatic in binary (Greek mono, “single”). 10 is also monautonomatic in binary, if the digit being described is 0: it’s in 2nd position or position 10 in binary. These numbers are monoautonomatic in binary too:


110100 = 52 (digit = 1)
10100101111 = 1327 (d=0)

In 110100, the 1s are in 1st, 2nd and 4th position, or positions 1, 10, 100 in binary. In 10100101111, the 0s are in 2nd, 4th, 5th and 7th position, or positions 10, 100, 101, 111 in binary. Here are more monautonomatic numbers in other bases:


21011 in base 4 = 581 (digit = 1)
11122122 in base 3 = 3392 (d=2)
131011 in base 5 = 5131 (d=1)
2101112 in base 4 = 9302 (d=1)
11122122102 in base 3 = 91595 (d=2)
13101112 in base 5 = 128282 (d=1)
210111221 in base 4 = 148841 (d=1)

For example, in 131011 the 1s are in 1st, 3rd, 5th and 6th position, or positions 1, 3, 10 and 11 in quinary. But these numbers run out quickly and the only monautonomatic number in bases 6 and higher is 1. However, there are infinitely long monoautonomatic integer sequences in all bases. For example, in binary this sequence at the Online Encyclopedia of Integer Sequences describes itself using the positions of its 1s:


A167502: 1, 10, 100, 111, 1000, 1001, 1010, 1110, 10001, 10010, 10100, 10110, 10111, 11000, 11010, 11110, 11111, 100010, 100100, 100110, 101001, 101011, 101100, 101110, 110000, 110001, 110010, 110011, 110100, 111000, 111001, 111011, 111101, 11111, …

In base 10, it looks like this:


A167500: 1, 2, 4, 7, 8, 9, 10, 14, 17, 18, 20, 22, 23, 24, 26, 30, 31, 34, 36, 38, 41, 43, 44, 46, 48, 49, 50, 51, 52, 56, 57, 59, 61, 62, 63, 64, 66, 67, 68, 69, 70, 71, 75, 77, 80, 83, 86, 87, 89, 91, 94, 95, 97, 99, 100, 101, 103, 104, 107, 109, 110, 111, 113, 114, 119, 120, 124, … (see A287515 for a similar sequence using 0s)

Can You Dij It? #2

It’s very simple, but I’m fascinated by it. I’m talking about something I call the digit-line, or the stream of digits you get when you split numbers in a particular base into individual digits. For example, here are the numbers one to ten in bases 2 and 3:

Base = 2: 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010…
Base = 3: 1, 2, 10, 11, 12, 20, 21, 22, 100, 101…


If you turn them into digit-lines, they look like this:

Base = 2: 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0… (A030190 in the Online Encyclopedia of Integer Sequences)
Base = 3: 1, 2, 1, 0, 1, 1, 1, 2, 2, 0, 2, 1, 2, 2, 1, 0, 0, 1, 0, 1… (A003137 in the OEIS)


At the tenth digit of the two digit-lines, both digits equal zero for the first time:

Base = 2: 1, 1, 0, 1, 1, 1, 0, 0, 1, 0
Base = 3: 1, 2, 1, 0, 1, 1, 1, 2, 2, 0


When the binary and ternary digits are represented together, the digit-lines look like this:

(1,1), (1,2), (0,1), (1,0), (1,1), (1,1), (0,1), (0,2), (1,2), (0,0)


But in base 4, the tenth digit of the digit-line is 1. So when do all the digits of the digit-line first equal zero for bases 2 to 4? Here the early integers in those bases:

Base 2: 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 10000, 10001, 10010, 10011, 10100, 10101…

Base 3: 1, 2, 10, 11, 12, 20, 21, 22, 100, 101, 102, 110, 111, 112, 120, 121, 122, 200, 201, 202, 210, 211, 212, 220, 221, 222, 1000, 1001, 1002…

Base 4: 1, 2, 3, 10, 11, 12, 13, 20, 21, 22, 23, 30, 31, 32, 33, 100, 101, 102, 103, 110, 111, 112, 113, 120, 121, 122, 123, 130, 131, 132, 133, 200…


And here are the digits of the digit-line in bases 2 to 4 represented together:

(1,1,1), (1,2,2), (0,1,3), (1,0,1), (1,1,0), (1,1,1), (0,1,1), (0,2,1), (1,2,2), (0,0,1), (1,2,3), (1,1,2), (1,2,0), (0,2,2), (1,1,1), (1,0,2), (1,0,2), (1,1,2), (0,0,3), (0,1,3), (0,1,0), (1,0,3), (0,2,1), (0,1,3), (1,1,2), (1,0,3), (0,1,3), (1,1,1), (0,1,0), (1,1,0), (0,1,1), (1,2,0), (1,1,1), (1,2,1), (1,0,0), (0,1,2), (0,2,1), (1,1,0), (1,1,3), (0,2,1), (1,2,1), (1,2,0), (1,0,1), (1,0,1), (0,2,1), (1,0,1), (1,1,1), (1,2,2), (1,0,1), (1,2,1), (0,2,3), (0,1,1), (0,0,2), (0,2,0), (1,1,1), (0,1,2), (0,2,1), (0,1,1), (1,2,2), (1,2,2), (0,2,1), (0,0,2), (1,2,3), (0,2,1), (1,1,3), (0,2,0), (0,2,1), (1,2,3), (1,1,1), (1,0,1), (0,0,3), (1,0,2), (0,1,1), (0,0,3), (1,0,3), (0,1,2), (1,1,0), (0,0,0)

At the 78th digit, all three digits equal zero. But the 78th digit of the digit-line in base 5 is 1. So when are the digits first equal to zero in bases 2 to 5? It’s not difficult to find out, but the difficulty of the search increases fast as the bases get bigger. Here are the results up to base 13 (note that bases 11 and 12 both have zeroes at digit 103721663):

dig=0 in bases 2 to 3 at the 10th digit of the digit-line
dig=0 in bases 2 to 4 at the 78th digit of the digit-line
dig=0 in bases 2 to 5 at the 182nd digit of the digit-line
dig=0 in bases 2 to 6 at the 302nd digit of the digit-line
dig=0 in bases 2 to 7 at the 12149th digit of the digit-line
dig=0 in bases 2 to 8 at the 45243rd digit of the digit-line
dig=0 in bases 2 to 9 at the 255261st digit of the digit-line
dig=0 in bases 2 to 10 at the 8850623rd digit of the digit-line
dig=0 in bases 2 to 12 at the 103721663rd digit of the digit-line
dig=0 in bases 2 to 13 at the 807778264th digit of the digit-line


I assume that, for any base b > 2, you can find some point in the digit-line at which d = 0 for all bases 2 to b. Indeed, I assume that this happens infinitely often. But I don’t know any short-cut for finding the first digit at which this occurs.


Previously pre-posted:

Can You Dij It? #1

Digital Rodeo

What a difference a digit makes. Suppose you take all representations of n in bases b <= n. When n = 3, the bases are 2 and 3, so 3 = 11 and 10, respectively. Next, count the occurrences of the digit 1:

digitcount(3, digit=1, n=11, 10) = 3

Add this digit-count to 3:

3 + digitcount(3, digit=1, n=11, 10) = 3 + 3 = 6.

Now apply the same procedure to 6. The bases will be 2 to 6:

6 + digitcount(6, digit=1, n=110, 20, 12, 11, 10) = 6 + 6 = 12

The procedure, n = n + digitcount(n,digit=1,base=2..n), continues like this:

12 + digcount(12,dig=1,n=1100, 110, 30, 22, 20, 15, 14, 13, 12, 11, 10) = 12 + 11 = 23
23 + digcount(23,dig=1,n=10111, 212, 113, 43, 35, 32, 27, 25, 23, 21, 1B, 1A, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10) = 23 + 21 = 44
44 + digcount(44,dig=1,n=101100, 1122, 230, 134, 112, 62, 54, 48, 44, 40, 38, 35, 32, 2E, 2C, 2A, 28, 26, 24, 22, 20, 1L, 1K, 1J, 1I, 1H, 1G, 1F, 1E, 1D, 1C, 1B, 1A, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10) = 44 + 31 = 75

And the sequence develops like this:

3, 6, 12, 23, 44, 75, 124, 202, 319, 503, 780, 1196, 1824, 2766, 4191, 6338, 9546, 14383, 21656, 32562, 48930, 73494, 110361, 165714, 248733, 373303, 560214, 840602, 1261237, 1892269, 2838926, 4258966, 6389157, 9584585, 14377879…

Now try the same procedure using the digit 0: n = n + digcount(n,dig=0,base=2..n). The first step is this:

3 + digcount(3,digit=0,n=11, 10) = 3 + 1 = 4

Next come these:

4 + digcount(4,dig=0,n=100, 11, 10) = 4 + 3 = 7
7 + digcount(7,dig=0,n=111, 21, 13, 12, 11, 10) = 7 + 1 = 8
8 + digcount(8,dig=0,n=1000, 22, 20, 13, 12, 11, 10) = 8 + 5 = 13
13 + digcount(13,dig=0,n=1101, 111, 31, 23, 21, 16, 15, 14, 13, 12, 11, 10) = 13 + 2 = 15
15 + digcount(15,dig=0,n=1111, 120, 33, 30, 23, 21, 17, 16, 15, 14, 13, 12, 11, 10) = 15 + 3 = 18
18 + digcount(18,dig=0,n=10010, 200, 102, 33, 30, 24, 22, 20, 18, 17, 16, 15, 14, 13, 12, 11, 10) = 18 + 9 = 27
27 + digcount(27,dig=0,n=11011, 1000, 123, 102, 43, 36, 33, 30, 27, 25, 23, 21, 1D, 1C, 1B, 1A, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10) = 27 + 7 = 34
34 + digcount(34,dig=0,n=100010, 1021, 202, 114, 54, 46, 42, 37, 34, 31, 2A, 28, 26, 24, 22, 20, 1G, 1F, 1E, 1D, 1C, 1B, 1A, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10) = 34 + 8 = 42
42 + digcount(42,dig=0,n=101010, 1120, 222, 132, 110, 60, 52, 46, 42, 39, 36, 33, 30, 2C, 2A, 28, 26, 24, 22, 20, 1K, 1J, 1I, 1H, 1G, 1F, 1E, 1D, 1C, 1B, 1A, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10) = 42 + 9 = 51

The sequence develops like this:

3, 4, 7, 8, 13, 15, 18, 27, 34, 42, 51, 59, 62, 66, 80, 94, 99, 111, 117, 125, 132, 151, 158, 163, 173, 180, 204, 222, 232, 244, 258, 279, 292, 307, 317, 324, 351, 364, 382, 389, 400, 425, 437, 447, 454, 466, 475, 483, 494, 509, 517, 536, 553, 566, 576, 612, 637, 649, 669, 679, 693, 712, 728, 753, 768, 801, 822, 835, 849, 862, 869, 883, 895, 906, 923, 932, 943, 949, 957, 967, 975, 999, 1011…

If you compare it with the sequence for digit=1, it appears that digcount(n,dig=1,b=2..n) is always larger than digcount(n,dig=0,b=2..n). That is in fact the case, with one exception, when n = 2:

digcount(2,dig=1,n=10) = 1
digcount(2,dig=0,n=10) = 1

When n = 10 (in base ten), there are twice as many ones as zeros:

digcount(10,dig=1,n=1010, 101, 22, 20, 14, 13, 12, 11, 10) = 10
digcount(10,dig=0,n=1010, 101, 22, 20, 14, 13, 12, 11, 10) = 5

As n gets larger, the difference grows dramatically:

digcount(100,dig=1,base=2..n) = 64
digcount(100,dig=0,base=2..n) = 16

digcount(1000,dig=1,base=2..n) = 533
digcount(1000,dig=0,base=2..n) = 25

digcount(10000,dig=1,base=2..n) = 5067
digcount(10000,dig=0,base=2..n) = 49

digcount(100000,dig=1,base=2..n) = 50140
digcount(100000,dig=0,base=2..n) = 73

digcount(1000000,dig=1,base=2..n) = 500408
digcount(1000000,dig=0,base=2..n) = 102

digcount(10000000,dig=1,base=2..n) = 5001032
digcount(10000000,dig=0,base=2..n) = 134

digcount(100000000,dig=1,base=2..n) = 50003137
digcount(100000000,dig=0,base=2..n) = 160

In fact, digcount(n,dig=1,b=2..n) is greater than the digit-count for any other digit: 0, 2, 3, 4, 5… (with the exception n = 2, as shown above). But digit=0 sometimes beats digits >= 2. For example, when n = 18:

digcount(18,dig=0,n=10010, 200, 102, 33, 30, 24, 22, 20, 18, 17, 16, 15, 14, 13, 12, 11, 10) = 9
digcount(18,dig=2,n=10010, 200, 102, 33, 30, 24, 22, 20, 18, 17, 16, 15, 14, 13, 12, 11, 10) = 7
digcount(18,dig=3,n=10010, 200, 102, 33, 30, 24, 22, 20, 18, 17, 16, 15, 14, 13, 12, 11, 10) = 4
digcount(18,dig=4,n=10010, 200, 102, 33, 30, 24, 22, 20, 18, 17, 16, 15, 14, 13, 12, 11, 10) = 2
digcount(18,dig=5,n=10010, 200, 102, 33, 30, 24, 22, 20, 18, 17, 16, 15, 14, 13, 12, 11, 10) = 1

But as n gets larger, digcount(0) will fall permanently behind all these digits. However, digcount(0) will always be greater than some digit d, for the obvious reason that some digits only appear when the base is high enough. For example, the hexadecimal digit A (with the decimal value 10) first appears when n = 21:

digcount(21,dig=A,n=10101, 210, 111, 41, 33, 30, 25, 23, 21, 1A, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10) = 1 digcount(21,dig=0,n=10101, 210, 111, 41, 33, 30, 25, 23, 21, 1A, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10) = 5

There is a general rule for the n at which digit d first appears, n = 2d + 1 (this doesn’t apply when d = 0 or d = 1):

d = 2, n = 5 = 2*2 + 1
digcount(5,dig=2,n=101, 12, 11, 10) = 1

d = 3, n = 7 = 2*3 + 1
digcount(7,dig=3,n=111, 21, 13, 12, 11, 10) = 1

d = 4, n = 9 = 2*4 + 1
digcount(9,dig=4,n=1001, 100, 21, 14, 13, 12, 11, 10) = 1

d = 5, n = 11 = 2*5 + 1
digcount(11,dig=5,n=1011, 102, 23, 21, 15, 14, 13, 12, 11, 10) = 1

It should be apparent, then, that the digit-count for a particular digit starts at 1 and gets gradually higher. The rate at which the digit-count increases is highest for 1 and lowest for 0, with digits 2, 3, 4, 5… in between:

All-Base Graph

Graph for digcount(n,dig=d,b=2..n)


You could think of the graph as a digital rodeo in which these digits compete with each other. 1 is the clear and permanent winner, 0 the gradual loser. Now recall the procedure introduced at the start: n = n + digcount(n,dig=d,b=2..n). When it’s applied to the digits 0 to 5, these are the sequences that appear:

n = n + digcount(n,dig=0,b=2..n)

2, 3, 4, 7, 8, 13, 15, 18, 27, 34, 42, 51, 59, 62, 66, 80, 94, 99, 111, 117, 125, 132, 151, 158, 163, 173, 180, 204, 222, 232, 244, 258, 279, 292, 307, 317, 324, 351, 364, 382, 389, 400, 425, 437, 447, 454, 466, 475, 483, 494, 509, 517, 536, 553, 566, 576, 612, 637, 649, 669, 679, 693, 712, 728, 753, 768, 801, 822, 835, 849, 862, 869, 883, 895, 906, 923, 932, 943, 949, 957, 967, 975, 999, 1011…

n = n + digcount(n,dig=1,b=2..n)

2, 3, 6, 12, 23, 44, 75, 124, 202, 319, 503, 780, 1196, 1824, 2766, 4191, 6338, 9546, 14383, 21656, 32562, 48930, 73494, 110361, 165714, 248733, 373303, 560214, 840602, 1261237, 1892269, 2838926, 4258966, 6389157, 9584585, 14377879…

n = n + digcount(n,dig=2,b=2..n)

5, 6, 8, 12, 16, 22, 31, 37, 48, 60, 76, 94, 115, 138, 173, 213, 257, 311, 374, 454, 542, 664, 790, 935, 1109, 1310, 1552, 1835, 2167, 2548, 2989, 3509, 4120, 4832, 5690, 6687, 7829, 9166, 10727, 12568, 14697, 17182, 20089, 23470, 27425, 32042, 37477, 43768, 51113, 59687, 69705, 81379, 94998, 110910, 129488, 151153, 176429, 205923, 240331, 280490, 327396, 382067, 445858…

n = n + digcount(n,dig=3,b=2..n)

7, 8, 9, 10, 11, 13, 16, 18, 22, 25, 29, 34, 38, 44, 50, 56, 63, 80, 90, 104, 113, 131, 151, 169, 188, 210, 236, 261, 289, 320, 350, 385, 424, 463, 520, 572, 626, 684, 747, 828, 917, 999, 1101, 1210, 1325, 1446, 1577, 1716, 1871, 2040, 2228, 2429, 2642, 2875, 3133, 3413, 3719, 4044, 4402, 4786, 5196, 5645, 6140, 6673, 7257, 7900, 8582, 9315, 10130, 10998, 11942, 12954, 14058…

n = n + digcount(n,dig=4,b=2..n)

9, 10, 11, 12, 13, 14, 16, 18, 20, 23, 25, 28, 34, 41, 44, 52, 61, 67, 74, 85, 92, 102, 113, 121, 134, 148, 170, 184, 208, 229, 253, 269, 287, 306, 324, 356, 386, 410, 439, 469, 501, 531, 565, 604, 662, 703, 742, 794, 845, 895, 953, 1007, 1062, 1127, 1188, 1262, 1336, 1421, 1503, 1585, 1676, 1777, 1876, 2001, 2104, 2249, 2375, 2502, 2636, 2789, 2938, 3102, 3267, 3444, 3644, 3868, 4099…

n = n + digcount(n,dig=5,b=2..n)

11, 12, 13, 14, 15, 16, 17, 19, 21, 23, 26, 28, 29, 33, 37, 41, 48, 50, 55, 60, 64, 67, 72, 75, 83, 91, 96, 102, 107, 118, 123, 129, 137, 151, 159, 171, 180, 192, 202, 211, 224, 233, 251, 268, 280, 296, 310, 324, 338, 355, 380, 401, 430, 455, 488, 511, 536, 562, 584, 607, 638, 664, 692, 718, 748, 778, 807, 838, 874, 911, 951, 993, 1039, 1081, 1124, 1166, 1216, 1264, 1313, 1370, 1432…

Fingering the Frigit

Fingers are fractal. Where a tree has a trunk, branches and twigs, a human being has a torso, arms and fingers. And human beings move in fractal ways. We use our legs to move large distances, then reach out with our arms over smaller distances, then move our fingers over smaller distances still. We’re fractal beings, inside and out, brains and blood-vessels, fingers and toes.

But fingers are fractal are in another way. A digit – digitus in Latin – is literally a finger, because we once counted on our fingers. And digits behave like fractals. If you look at numbers, you’ll see that they contain patterns that echo each other and, in a sense, recur on smaller and smaller scales. The simplest pattern in base 10 is (0, 1, 2, 3, 4, 5, 6, 7, 8, 9). It occurs again and again at almost very point of a number, like a ten-hour clock that starts at zero-hour:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9…
10, 11, 12, 13, 14, 15, 16, 17, 18, 19…
200… 210… 220… 230… 240… 250… 260… 270… 280… 290…

These fractal patterns become visible if you turn numbers into images. Suppose you set up a square with four fixed points on its corners and a fixed point at its centre. Let the five points correspond to the digits (1, 2, 3, 4, 5) of numbers in base 6 (not using 0, to simplify matters):

1, 2, 3, 4, 5, 11, 12, 13, 14, 15, 21, 22, 23, 24, 25, 31, 32, 33, 34, 35, 41, 42, 43, 44, 45, 51, 52, 53, 54, 55, 61, 62, 63, 64, 65… 2431, 2432, 2433, 2434, 2435, 2441, 2442, 2443, 2444, 2445, 2451, 2452…

Move between the five points of the square by stepping through the individual digits of the numbers in the sequence. For example, if the number is 2451, the first set of successive digits is (2, 4), so you move to a point half-way between point 2 and point 4. Next come the successive digits (4, 5), so you move to a point half-way between point 4 and point 5. Then come (5, 1), so you move to a point half-way between point 5 and point 1.

When you’ve exhausted the digits (or frigits) of a number, mark the final point you moved to (changing the colour of the pixel if the point has been occupied before). If you follow this procedure using a five-point square, you will create a fractal something like this:
fractal4_1single

fractal4_1
A pentagon without a central point using numbers in a zero-less base 7 looks like this:
fractal5_0single

fractal5_0
A pentagon with a central point looks like this:
fractal5_1single

fractal5_1
Hexagons using a zero-less base 8 look like this:
fractal6_1single

fractal6_1


fractal6_0single

fractal6_0
But the images above are just the beginning. If you use a fixed base while varying the polygon and so on, you can create images like these (here is the program I used):
fractal4


fractal5


fractal6789

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.

Miss This

1,729,404 is seven digits long. If you drop one digit at a time, you can create seven more numbers from it, each six digits long. If you add these numbers, something special happens:

1,729,404 → 729404 (missing 1) + 129404 (missing 7) + 179404 (missing 2) + 172404 + 172904 + 172944 + 172940 = 1,729,404

So 1,729,404 is narcissistic, or equal to some manipulation of its own digits. Searching for numbers like this might seem like a big task, but you can cut the search-time considerably by noting that the final two digits determine whether a number is a suitable candidate for testing. For example, what if a seven-digit number ends in …38? Then the final digit of the missing-digit sum will equal (3 x 1 + 8 x 6) modulo 10 = (3 + 48) mod 10 = 51 mod 10 = 1. This means that you don’t need to check any seven-digit number ending in …38.

But what about seven-digit numbers ending in …57? Now the final digit of the sum will equal (5 x 1 + 7 x 6) modulo 10 = (5 + 42) mod 10 = 47 mod 10 = 7. So seven-digit numbers ending in …57 are possible missing-digit narcissistic sums. Then you can test numbers ending …157, …257, …357 and so on, to determine the last-but-one digit of the sum. Using this method, one quickly finds the only two seven-digit numbers of this form in base-10:

1,729,404 → 729404 + 129404 + 179404 + 172404 + 172904 + 172944 + 172940 = 1,729,404

1,800,000 → 800000 + 100000 + 180000 + 180000 + 180000 + 180000 + 180000 = 1,800,000

What about eight-digit numbers? Only those ending in these two digits need to be checked: …00, …23, …28, …41, …46, …64, …69, …82, …87. Here are the results:

• 13,758,846 → 3758846 + 1758846 + 1358846 + 1378846 + 1375846 + 1375846 + 1375886 + 1375884 = 13,758,846
• 13,800,000 → 3800000 + 1800000 + 1300000 + 1380000 + 1380000 + 1380000 + 1380000 + 1380000 = 13,800,000
• 14,358,846 → 4358846 + 1358846 + 1458846 + 1438846 + 1435846 + 1435846 + 1435886 + 1435884 = 14,358,846
• 14,400,000 → 4400000 + 1400000 + 1400000 + 1440000 + 1440000 + 1440000 + 1440000 + 1440000 = 14,400,000
• 15,000,000 → 5000000 + 1000000 + 1500000 + 1500000 + 1500000 + 1500000 + 1500000 + 1500000 = 15,000,000
• 28,758,846 → 8758846 + 2758846 + 2858846 + 2878846 + 2875846 + 2875846 + 2875886 + 2875884 = 28,758,846
• 28,800,000 → 8800000 + 2800000 + 2800000 + 2880000 + 2880000 + 2880000 + 2880000 + 2880000 = 28,800,000
• 29,358,846 → 9358846 + 2358846 + 2958846 + 2938846 + 2935846 + 2935846 + 2935886 + 2935884 = 29,358,846
• 29,400,000 → 9400000 + 2400000 + 2900000 + 2940000 + 2940000 + 2940000 + 2940000 + 2940000 = 29,400,000

But there are no nine-digit sumbers, or nine-digit numbers that supply missing-digit narcissistic sums. What about ten-digit sumbers? There are twenty-one:

1,107,488,889; 1,107,489,042; 1,111,088,889; 1,111,089,042; 3,277,800,000; 3,281,400,000; 4,388,888,889; 4,388,889,042; 4,392,488,889; 4,392,489,042; 4,500,000,000; 5,607,488,889; 5,607,489,042; 5,611,088,889; 5,611,089,042; 7,777,800,000; 7,781,400,000; 8,888,888,889; 8,888,889,042; 8,892,488,889; 8,892,489,042 (21 numbers)

Finally, the nine eleven-digit sumbers all take this form:

30,000,000,000 → 0000000000 + 3000000000 + 3000000000 + 3000000000 + 3000000000 + 3000000000 + 3000000000 + 3000000000 + 3000000000 + 3000000000 + 3000000000 = 30,000,000,000

So that’s forty-one narcissistic sumbers in base-10. Not all of them are listed in Sequence A131639 at the Encyclopedia of Integer Sequences, but I think I’ve got my program working right. Other bases show similar patterns. Here are some missing-digit narcissistic sumbers in base-5:

• 1,243 → 243 + 143 + 123 + 124 = 1,243 (b=5) = 198 (b=10)
• 1,324 → 324 + 124 + 134 + 132 = 1,324 (b=5) = 214 (b=10)
• 1,331 → 331 + 131 + 131 + 133 = 1,331 (b=5) = 216 (b=10)
• 1,412 → 412 + 112 + 142 + 141 = 1,412 (b=5) = 232 (b=10)

• 100,000 → 00000 + 10000 + 10000 + 10000 + 10000 + 10000 = 100,000 (b=5) = 3,125 (b=10)
• 200,000 → 00000 + 20000 + 20000 + 20000 + 20000 + 20000 = 200,000 (b=5) = 6,250 (b=10)
• 300,000 → 00000 + 30000 + 30000 + 30000 + 30000 + 30000 = 300,000 (b=5) = 9,375 (b=10)
• 400,000 → 00000 + 40000 + 40000 + 40000 + 40000 + 40000 = 400,000 (b=5) = 12,500 (b=10)

And here are some sumbers in base-16:

5,4CD,111,0EE,EF0,542 = 4CD1110EEEF0542 + 5CD1110EEEF0542 + 54D1110EEEF0542 + 54C1110EEEF0542 + 54CD110EEEF0542 + 54CD110EEEF0542 + 54CD110EEEF0542 + 54CD111EEEF0542 + 54CD1110EEF0542 + 54CD1110EEF0542 + 54CD1110EEF0542 + 54CD1110EEE0542 + 54CD1110EEEF542 + 54CD1110EEEF042 + 54CD1110EEEF052 + 54CD1110EEEF054 (b=16) = 6,110,559,033,837,421,890 (b=10)

6,5DD,E13,CEE,EF0,542 = 5DDE13CEEEF0542 + 6DDE13CEEEF0542 + 65DE13CEEEF0542 + 65DE13CEEEF0542 + 65DD13CEEEF0542 + 65DDE3CEEEF0542 + 65DDE1CEEEF0542 + 65DDE13EEEF0542 + 65DDE13CEEF0542 + 65DDE13CEEF0542 + 65DDE13CEEF0542 + 65DDE13CEEE0542 + 65DDE13CEEEF542 + 65DDE13CEEEF042 + 65DDE13CEEEF052 + 65DDE13CEEEF054 (b=16) = 7,340,270,619,506,705,730 (b=10)

10,000,000,000,000,000 → 0000000000000000 + 1000000000000000 + 1000000000000000 + 1000000000000000 + 1000000000000000 + 1000000000000000 + 1000000000000000 + 1000000000000000 + 1000000000000000 + 1000000000000000 + 1000000000000000 + 1000000000000000 + 1000000000000000 + 1000000000000000 + 1000000000000000 + 1000000000000000 + 1000000000000000 = 10,000,000,000,000,000 (b=16) = 18,446,744,073,709,551,616 (b=10)

F0,000,000,000,000,000 → 0000000000000000 + F000000000000000 + F000000000000000 + F000000000000000 + F000000000000000 + F000000000000000 + F000000000000000 + F000000000000000 + F000000000000000 + F000000000000000 + F000000000000000 + F000000000000000 + F000000000000000 + F000000000000000 + F000000000000000 + F000000000000000 + F000000000000000 = F0,000,000,000,000,000 (b=16) = 276,701,161,105,643,274,240 (b=10)

Next I’d like to investigate sumbers created by missing two, three and more digits at a time. Here’s a taster:

1,043,101 → 43101 (missing 1 and 0) + 03101 (missing 1 and 4) + 04101 (missing 1 and 3) + 04301 + 04311 + 04310 + 13101 + 14101 + 14301 + 14311 + 14310 + 10101 + 10301 + 10311 + 10310 + 10401 + 10411 + 10410 + 10431 + 10430 + 10431 = 1,043,101 (b=5) = 18,526 (b=10)

Factory Records

The factors of n are those numbers that divide n without remainder. So the factors of 6 are 1, 2, 3 and 6. If the function s(n) is defined as “the sum of the factors of n, excluding n, then s(6) = 1 + 2 + 3 = 6. This makes 6 a perfect number: its factors re-create it. 28 is another perfect number. The factors of 28 are 1, 2, 4, 7, 14 and 28, so s(28) = 1 + 2 + 4 + 7 + 14 = 28. Other perfect numbers are 496 and 8128. And they’re perfect in any base.

Amicable numbers are amicable in any base too. The factors of an amicable number sum to a second number whose factors sum to the first number. So s(220) = 284, s(284) = 220. That pair may have been known to Pythagoras (c.570-c.495 BC), but s(1184) = 1210, s(1210) = 1184 was discovered by an Italian schoolboy called Nicolò Paganini in 1866. There are also sociable chains, in which s(n), s(s(n)), s(s(s(n))) create a chain of numbers that leads back to n, like this:

12496 → 14288 → 15472 → 14536 → 14264 → 12496 (c=5)

Or this:

14316 → 19116 → 31704 → 47616 → 83328 → 177792 → 295488 → 629072 → 589786 → 294896 → 358336 → 418904 → 366556 → 274924 → 275444 → 243760 → 376736 → 381028 → 285778 → 152990 → 122410 → 97946 → 48976 → 45946 → 22976 → 22744 → 19916 → 17716 → 14316 (c=28)

Those sociable chains were discovered (and christened) in 1918 by the Belgian mathematician Paul Poulet (1887-1946). Other factor-sum patterns are dependant on the base they’re expressed in. For example, s(333) = 161. So both n and s(n) are palindromes in base-10. Here are more examples — the numbers in brackets are the prime factors of n and s(n):

333 (3^2, 37) → 161 (7, 23)
646 (2, 17, 19) → 434 (2, 7, 31)
656 (2^4, 41) → 646 (2, 17, 19)
979 (11, 89) → 101 (prime)
1001 (7, 11, 13) → 343 (7^3)
3553 (11, 17, 19) → 767 (13, 59)
10801 (7, 1543) → 1551 (3, 11, 47)
11111 (41, 271) → 313 (prime)
18581 (17, 1093) → 1111 (11, 101)
31713 (3, 11, 31^2) → 15951 (3, 13, 409)
34943 (83, 421) → 505 (5, 101)
48484 (2^2, 17, 23, 31) → 48284 (2^2, 12071)
57375 (3^3, 5^3, 17) → 54945 (3^3, 5, 11, 37)
95259 (3, 113, 281) → 33333 (3, 41, 271)
99099 (3^2, 7, 11^2, 13) → 94549 (7, 13, 1039)
158851 (7, 11, 2063) → 39293 (prime)
262262 (2, 7, 11, 13, 131) → 269962 (2, 7, 11, 1753)
569965 (5, 11, 43, 241) → 196691 (11, 17881)
1173711 (3, 7, 11, 5081) → 777777 (3, 7^2, 11, 13, 37)

Note how s(656) = 646 and s(646) = 434. There’s an even longer sequence in base-495:

33 → 55 → 77 → 99 → [17][17] → [19][19] → [21][21] → [43][43] → [45][45] → [111][111] → [193][193] → [195][195] → [477][477] (b=495) (c=13)
1488 (2^4, 3, 31) → 2480 (2^4, 5, 31) → 3472 (2^4, 7, 31) → 4464 (2^4, 3^2, 31) → 8432 (2^4, 17, 31) → 9424 (2^4, 19, 31) → 10416 (2^4, 3, 7, 31) → 21328 (2^4, 31, 43) → 22320 (2^4, 3^2, 5, 31) → 55056 (2^4, 3, 31, 37) → 95728 (2^4, 31, 193) → 96720 (2^4, 3, 5, 13, 31) → 236592 (2^4, 3^2, 31, 53)

I also tried looking for n whose s(n) mirrors n. But they’re hard to find in base-10. The first example is this:

498906 (2, 3^3, 9239) → 609894 (2, 3^2, 31, 1093)

498906 mirrors 609894, because the digits of each run in reverse to the digits of the other. Base-9 does better for mirror-sums, clocking up four in the same range of integers:

42 → 24 (base=9)
38 (2, 19) → 22 (2, 11)
402 → 204 (base=9)
326 (2, 163) → 166 (2, 83)
4002 → 2004 (base=9)
2918 (2, 1459) → 1462 (2, 17, 43)
5544 → 4455 (base=9)
4090 (2, 5, 409) → 3290 (2, 5, 7, 47)

Base-11 does better still, clocking up eight in the same range:

42 → 24 (base=11)
46 (2, 23) → 26 (2, 13)
2927 → 7292 (base=11)
3780 (2^2, 3^3, 5, 7) → 9660 (2^2, 3, 5, 7, 23)
4002 → 2004 (base=11)
5326 (2, 2663) → 2666 (2, 31, 43)
13772 → 27731 (base=11)
19560 (2^3, 3, 5, 163) → 39480 (2^3, 3, 5, 7, 47)
4[10]7[10]9 → 9[10]7[10]4 (base=11)
72840 (2^3, 3, 5, 607) → 146040 (2^3, 3, 5, 1217)
6929[10] → [10]9296 (base=11)
100176 (2^4, 3, 2087) → 158736 (2^4, 3, 3307)
171623 → 326171 (base=11)
265620 (2^2, 3, 5, 19, 233) → 520620 (2^2, 3, 5, 8677)
263702 → 207362 (base=11)
414790 (2, 5, 41479) → 331850 (2, 5^2, 6637)

Note that 42 mirrors its factor-sum in both base-9 and base-11. But s(42) = 24 in infinitely many bases, because when 42 = 2 x prime, s(42) = 1 + 2 + prime. So (prime-1) / 2 will give the base in which 24 = s(42). For example, 2 x 11 = 22 and 22 = 42 in base (11-1) / 2 or base-5. So s(42) = 1 + 2 + 11 = 14 = 2 x 5 + 4 = 24[b=5]. There are infinitely many primes, so infinitely many bases in which s(42) = 24.

Base-10 does better for mirror-sums when s(n) is re-defined to include n itself. So s(69) = 1 + 3 + 23 + 69 = 96. Here are the first examples of all-factor mirror-sums in base-10:

69 (3, 23) → 96 (2^5, 3)
276 (2^2, 3, 23) → 672 (2^5, 3, 7)
639 (3^2, 71) → 936 (2^3, 3^2, 13)
2556 (2^2, 3^2, 71) → 6552 (2^3, 3^2, 7, 13)

In the same range, base-9 now produces one mirror-sum, 13 → 31 = 12 (2^2, 3) → 28 (2^2, 7). Base-11 produces no mirror-sums in the same range. Base behaviour is eccentric, but that’s what makes it interesting.