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.

Roo’s Who

11 is a prime number, divisible by only itself and 1. If you add its digits, 1 + 1, you get 2. 11 + 2 = 13, another prime number. And 13 + (1 + 3) = 17, a third prime number. And there it ends, because 17 + (1 + 7) = 25 = 5 x 5. I call (11, 13, 17) kangaroo primes, because one jumps to another. In base 10, the record for numbers below 1,000,000 is this:

6 primes: 516493 + 28 = 516521 + 20 = 516541 + 22 = 516563 + 26 = 516589 + 34 = 516623.

In base 16, the record is this:

8 primes: 97397 = 17,C75[b=16] + 32 = 97429 = 17,C95[b=16] + 34 = 97463 = 17,CB7[b=16] + 38 = 97501 = 17,CDD[b=16] + 46 = 97547 = 17,D0B[b=16] + 32 = 97579 = 17,D2B[b=16] + 34 = 97613 = 17,D4D[b=16] + 38 = 97651 = 17,D73[b=16].

Another kind of kangaroo prime is found not by adding the sum of digits, but by adding their product, i.e., the result of multiplying the digits (except 0). 23 + (2 x 3) = 29. 29 + (2 x 9) = 47. But 47 + (4 x 7) = 75 = 3 x 5 x 5. So (23, 29, 47) are kangaroo primes too. In base 10, the record for numbers below 1,000,000 is this:

9 primes: 524219 + 720 = 524939 + 9720 = 534659 + 16200 = 550859 + 9000 = 559859 + 81000 = 640859 + 8640 = 649499 + 69984 = 719483 + 6048 = 725531.

But what about subtraction? For a reason I don’t understand, subtracting the digit-sum doesn’t seem to create any kangaroo-primes in base 10. But 11 in base 8 is 13 = 1 x 8^1 + 3 x 8^0 and 13[b=8] – (1 + 3) = 7. In base 2, this sequence appears:

1619 = 11,001,010,011[b=2] – 6 = 1613 = 11,001,001,101[b=2] – 6 = 1607 = 11,001,000,111[b=2] – 6 = 1601 = 11,001,000,001[b=2] – 4 = 1597.

However, subtracting the digit-product creates kangaroo-primes in base 10. For example, 23 – (2 x 3) = 17. The record below 1,000,000 is this (when 0 is found in the digits of a number, it is not included in the multiplication):

7 primes: 64037 – 504 = 63533 – 810 = 62723 – 504 = 62219 – 216 = 62003 – 36 = 61967 – 2268 = 59699.

Base 2 also provides examples of addition/subtraction pairs of kangaroo-primes, like this:

3 = 11[b=2] + 2 = 5 = 101[b=2] | 5 = 101[b=2] – 2 = 3

277 = 100,010,101[b=2] + 4 = 281 = 100,011,001[b=2] | 281 – 4 = 277

311 = 100,110,111[b=2] + 6 = 317 = 100,111,101[b=2] | 317 – 6 = 311

In base 10, addition/subtraction pairs are created by the digit-product, like this:

239 + 54 = 293 | 293 – 54 = 239
563 + 90 = 653 | 653 – 90 = 563
613 + 18 = 631 | 631 – 18 = 613
2791 + 126 = 2917 | 2917 – 126 = 2791
3259 + 270 = 3529 | 3529 – 270 = 3259
5233 + 90 = 5323 | 5323 – 90 = 5233
5297 + 630 = 5927 | 5927 – 630 = 5297
6113 + 18 = 6131 | 6131 – 18 = 6113
10613 + 18 = 10631 | 10631 – 18 = 10613
12791 + 126 = 12917 | 12917 – 126 = 12791

You could call these boxing primes, like boxing kangaroos. The two primes in the pair usually have the same digits in different arrangements, but there are also pairs like these:

24527 + 560 = 25087 | 25087 – 560 = 24527
25183 + 240 = 25423 | 25423 – 240 = 25183
50849 + 1440 = 52289 | 52289 – 1440 = 50849