Wednesday, December 24

Pleasantly nonplussed

Eric Angelini suggested on Monday the sequence of numbers with the property that if one inserts a single plus anywhere inside them (and executes the additions) only primes result. In deference to the second part of the number-split not starting with it, he only allowed zero as a final digit:

11, 12, 14, 16, 20, 21, 23, 25, 29, 30, 32, 34, 38, 41, 43, 47, 49, 50, 52, 56, 58, 61, 65, 67, 70, 74, 76, 83, 85, 89, 92, 94, 98, 110, 112, 116, 118, 130, 136, 152, 158, 170, ...

Surely this sequence is finite. But what is the largest term? My program hinted that it might be the 11-digit 46884486265 (term #440), since it found no 12-digit representative. But (thankfully) I had the computation plod on:

5391391551358

5 + 391391551358 = 391391551363
53 + 91391551358 = 91391551411
539 + 1391551358 = 1391551897
5391 + 391551358 = 391556749
53913 + 91551358 = 91605271
539139 + 1551358 = 2090497
5391391 + 551358 = 5942749
53913915 + 51358 = 53965273
539139155 + 1358 = 539140513
5391391551 + 358 = 5391391909
53913915513 + 58 = 53913915571
539139155135 + 8 = 539139155143

All prime! By plugging 5391391551358 into Google, I discovered that this number was already known to Giovanni Resta, who treated the sequence from the perspective of allowing internal zeros. The numbers 20, 101, and 1001 appear to be (currently) missing from his magnanimous numbers list. But, he has one larger example:

97393713331910

9 + 7393713331910 = 7393713331919
97 + 393713331910 = 393713332007
973 + 93713331910 = 93713332883
9739 + 3713331910 = 3713341649
97393 + 713331910 = 713429303
973937 + 13331910 = 14305847
9739371 + 3331910 = 13071281
97393713 + 331910 = 97725623
973937133 + 31910 = 973969043
9739371333 + 1910 = 9739373243
97393713331 + 910 = 97393714241
973937133319 + 10 = 973937133329
9739371333191 + 0 = 9739371333191

Nice.