# Prime Climb Time

The third prime is equal to the sum of the first and second primes: 2 + 3 = 5. After that, for obvious reasons, the prime-sum climbs much more rapidly than the primes themselves:

```2, 3, 05, 07, 11, 13, 17, 19, 023, 029...
2, 5, 10, 17, 28, 41, 58, 77, 100, 129...
```

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:

```2, 3, 05, 07, 11, 13, 17, 19, 23, 29...
2, 5, 10, 17, 19, 23, 31, 41, 46, 57...
```

The sum climbs more slowly, but still too fast. So what about a different base? In base-2, the digit-sum(p1..p3) = (1+0) + (1+1) + (1+0+1) = 1 + 2 + 2 = 5. The comparison looks like this:

```2, 3, 05, 07, 11, 13, 17, 19, 23, 29...
1, 3, 05, 08, 11, 14, 16, 19, 23, 27...
```

For primes 3, 5, 11, 19, and 23, p = digit-sum(primes <= p) in base-2. But the cumulative digit-sum soon begins to climb too slowly:

```2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271...

1, 3, 5, 8, 11, 14, 16, 19, 23, 27, 32, 35, 38, 42, 47, 51, 56, 61, 64, 68, 71, 76, 80, 84, 87, 091, 096, 101, 106, 110, 117, 120, 123, 127, 131, 136, 141, 145, 150, 155, 160, 165, 172, 175, 179, 184, 189, 196, 201, 206, 211, 218, 223, 230, 232, 236, 240, 245...```

```2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59...
2, 3, 6, 9, 12, 15, 20, 23, 28, 31, 34, 37, 42, 47, 52, 59, 64...
```

In base-3, for p = 2, 3 and 37, p = digit-sum(primes <= p), while for p = 23, 31, 47 and 59, p = digit-sum(primes < p), like this:

2 = 2.
3 = 2 + (1+0).
37 = 2 + (1+0) + (1+2) + (2+1) + (1+0+2) + (1+1+1) + (1+2+2) + (2+0+1) + (2+1+2) + (1+0+0+2) + (1+0+1+1) + (1+1+0+1) = 2 + 1 + 3 + 3 + 3 + 3 + 5 + 3 + 5 + 3 + 3 + 3.

23 = 2 + (1+0) + (1+2) + (2+1) + (1+0+2) + (1+1+1) + (1+2+2) + (2+0+1) = 2 + 1 + 3 + 3 + 3 + 3 + 5 + 3.
31 = 2 + (1+0) + (1+2) + (2+1) + (1+0+2) + (1+1+1) + (1+2+2) + (2+0+1) + (2+1+2) + (1+0+0+2) = 2 + 1 + 3 + 3 + 3 + 3 + 5 + 3 + 5 + 3.
47 = 2 + (1+0) + (1+2) + (2+1) + (1+0+2) + (1+1+1) + (1+2+2) + (2+0+1) + (2+1+2) + (1+0+0+2) + (1+0+1+1) + (1+1+0+1) + (1+1+1+2) + (1+1+2+1) = 2 + 1 + 3 + 3 + 3 + 3 + 5 + 3 + 5 + 3 + 3 + 3 + 5 + 5.
59 = 2 + (1+0) + (1+2) + (2+1) + (1+0+2) + (1+1+1) + (1+2+2) + (2+0+1) + (2+1+2) + (1+0+0+2) + (1+0+1+1) + (1+1+0+1) + (1+1+1+2) + (1+1+2+1) + (1+2+0+2) + (1+2+2+2) = 2 + 1 + 3 + 3 + 3 + 3 + 5 + 3 + 5 + 3 + 3 + 3 + 5 + 5 + 5 + 7.

This carries on for a long time. For these primes, p = digit-sum(primes < p):

23, 31, 47, 59, 695689, 698471, 883517, 992609, 992737, 993037, 1314239, 1324361, 1324571, 1326511, 1327289, 1766291, 3174029

And for these primes, p = digit-sum(primes <= p):

3, 37, 695663, 695881, 1308731, 1308757, 1313153, 1314301, 1326097, 1766227, 3204779, 14328191

Now try the cumulative digit-sum in base-4:

```2, 3, 5, 07, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59...
2, 5, 7, 11, 16, 20, 22, 26, 31, 36, 43, 47, 52, 59, 67, 72, 80...
```

The sum of digits climbs too fast. Base-3 is the Goldilocks base, climbing neither too slowly, like base-2, nor too fast, like all bases greater than 3.

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