You can apply these formulae in other bases and it’s trivially obvious that the sequences rise most slowly in base 2, because you’re never summing or multiplying anything but the digit 1. However, there is a sequence for which base 2 is by far the best performer. It has the formula n(i) = n(i-1) + blockmult(n(i-1)), where blockmult(n) counts the lengths of distinct blocks of the same digit, including 0, then multiplies those lengths together. For example:

The formula also returns 1 much further along the sequence in base 3. For example, the 573809th number in the sequence, or n(573809), is 5775037 and blockmult(5775037) = blockmult(101212101212021) = 1^15 = 1. But in base 2, blockmult(n) = 1 is very rare. It happens three times at the beginning of the sequence:

1, 2, 3, 5, 6, 8, 11…

After that, I haven’t found any more examples of blockmult(n) = 1, although blockmult(n) = 2 occurs regularly. For example,

Does the sequence in base 2 return another example of blockmult(n) = 1? The odds seem against it. For any given number of digits in base 2, there is only one number for which blockmult(n) = 1. For example: 1, 10, 101, 1010, 10101, 101010, 1010101… As the sequence increases, the percentage of these numbers becomes smaller and smaller. But the sequence is infinite, so who knows what happens in the end? Perhaps blockmult(n) = 1 occurs infinitely often.

Given a number at random, is there a quick way to say whether it appears in the sequence seeded with 1? Not that I know, with one exception. If the number is divisible by 3, it doesn’t appear, at least in base 10. In base 2, that rule doesn’t apply:

What patterns are there in these sequences? It’s easier to check when they’re represented graphically, so I converted them into patterns à la the Ulam spiral, where n is represented as a dot on a spiral of integers. This is the spiral for base 10:

Base 10

And these are the spirals for bases 2 and 3:

Base 2

Base 3

These sequences look fairly random to me: there are no obvious patterns in the jumps from n(i) to n(i+1), i.e. in the values for digitsum(n(i)). Now try the spirals for bases 9 and 33:

Base 9

Base 33

Patterns have appeared: there is some regularity in the jumps. You can see these regularities more clearly if you represent digitsum(n(i)) as a graph, with n(i) on the x axis and digitsum(n(i)) on the y axis. If the graph starts with n(i) = 1 on the lower left and proceeds left-right, left-right up the screen, it looks like this in base 10:

In some bases, the formula n(i) = n(i-1) + digitsum(n(i-1)) generates mild randomness. In others, it generates strong regularity, like waves rolling ashore under a steady wind. I don’t understand why, but regularity seems to occur in bases that are one more than a power of 2 and also in some bases that are primes or squares.

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:

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:

I’m interested in digit-sums and in palindromic numbers. Looking at one, I found the other. It started like this: 9^2 = 81 and 9 = 8 + 1, so digitsum(9^1) = digitsum(9^2). I wondered how long such a sequence of powers could be (excluding powers of 10). I quickly found that the digit-sum of 468 is equal to the digit-sum of its square and cube:

digsum(468) = digsum(219024) = digsum(102503232)

But I couldn’t find any longer sequence, although plenty of other numbers are similar to 468:

In maths, one thing leads to another. I wondered whether, in a spiral of integers, any number was equal to the digit-sum of the numbers on the route traced by moving to the origin first horizontally, then vertically. To illustrate the procedure, here is a 9×9 integer spiral containing 81 numbers:

Take the number 21, which is three places across and up from the bottom left corner of the spiral. The route to the origin contains the numbers 21, 22, 23, 8 and 1, because first you move right two places, then up two places. And 21 is what I call a route number, because 21 = 3 + 4 + 5 + 8 + 1 = digitsum(21) + digitsum(22) + digitsum(23) + digitsum(8) + digitsum(1). Beside the trivial case of 1, there are two more route numbers in the spiral:

Then I wondered about other possible routes to the origin. Think of the origin as one corner of a rectangle and the number being tested as the diagonal corner. Suppose that you always move away from the starting corner, that is, you always move up or right (or up and left, and so on, depending on where the corners lie). In a x by y rectangle, how many routes are there between the diagonal corners under those conditions?

It’s an interesting question, but first I’ve looked at the simpler case of an n by n square. You can encode each route as a binary number, with 0 representing a vertical move and 1 representing a horizontal move. The problem then becomes equivalent to finding the number of distinct ways you can arrange equal numbers of 1s and 0s. If you use this method, you’ll discover that there are two routes across the 2×2 square, corresponding to the binary numbers 01 and 10:

Across the 3×3 square, there are six routes, corresponding to the binary numbers 0011, 0101, 0110, 1001, 1010 and 1100:

Across the 4×4 square, there are twenty routes:

(Please open in new window if it fails to animate)

Across the 5×5 square, there are 70 routes:

(Please open in new window etc)

Across the 6×6 and 7×7 squares, there are 252 and 924 routes:

After that, the routes quickly increase in number. This is the list for n = 1 to 14:

After that you can vary the conditions. What if you can move not just vertically and horizontally, but diagonally, i.e. vertically and horizontally at the same time? Now you can encode the route with a ternary number, or number in base 3, with 0 representing a vertical move, 1 a horizontal move and 2 a diagonal move. As before, there is one route across a 1×1 square, but there are three across a 2×2, corresponding to the ternary numbers 01, 2 and 10:

But what if you use digit-sum(p1..pn), i.e., the sum of the digits of the primes from the first to the nth? For example, the digit-sum(p1..p5) = 2 + 3 + 5 + 7 + 1+1 = 19, whereas the sum(p1..p5) = 2 + 3 + 5 + 7 + 11 = 28. Using the digit-sums of the primes, the comparison now looks like this:

4 x 3 = 13. A mistake? Not in base-9, where 13 = 1×9^1 + 3 = 12 in base-10. This means that 13 is a sum-product number in base-9: first add its digits, then multiply them, then multiply the digit-sum by the digit-product: (1+3) x (1×3) = 13[9]. There are four more sum-product numbers in this base:

And base-6? Six Nix. There are no sum-product numbers unique to that base (to the best of my far-from-infallible knowledge). Here is the full list for base-3 to base-50 (not counting 0 and 1 as sum-product numbers):

But those are tiny numbers compared to 6^(6^6). That means 6^46,656 and equals roughly 2·6591… x 10^36,305. It’s 36,306 digits long and its full digit-sum is 162,828. However, 666 lies concealed in those digits too. To see how, consider the function Σ(x1,xn), which returns the sum of digits 1 to n of x. For example, π = 3·14159265…, so Σ(π1,π4) = 3 + 1 + 4 + 1 = 9. The first 150 digits of 6^(6^6) are these:

There’s nothing special about these patterns: infinitely many numbers are narcissistic in similar ways. However, 666 has a special cultural significance, so people pay it more attention and look for patterns related to it more carefully. Who cares, for example, that 667 = digit-sum(667^48) = digit-sum(667^54) = digit-sum(667^58)? Fans of recreational maths will, but not very much. The Number of the Beast is much more fun, narcissistically and otherwise:

The number 23 is special, inter alia, because it’s prime, divisible by only itself and 1. It’s also special because its reciprocal has maximum period. That is, the digits of 1/23 come in repeated blocks of 22, like this:

This means that 7 is narcissistic: it reflects itself by manipulation of the digits of 1/7. But that’s in base ten. If you try base eight, 23 becomes narcissistic too (note that 23 = 2 x 8 + 7, so 23 in base eight is 27):