Live data from Hacker News

Any positive number can be written as a sum of three palindromes

somethingorotherwhatever.com

81–90 of 114 posts

Re: Any positive number can be written as a sum of three palindromes

#84

Earlier quoted context omitted.

Still a bit boring, feels like cheating, something like 12321 + X + Y would be nice.

55555 = 12321 + 43234 + 0 :) And if you don't like that: 55555 = 12321 + 23132 + 20102 Palindromes are sort of the least surprising numbers to have this property because you can easily "split" them into as many palindromes as you want like this. The surprising result is that you could write something like 19837100018374 as the sum of only 3 palindromes.

More surprising is that you can do it in any base >= 5

Re: Any positive number can be written as a sum of three palindromes

#85
post #73
post #72

Earlier quoted context omitted.

There's a stronger generalization: it's true of any divisor of the base (not just prime divisors and not just proper divisors). For example, it works for divisibility by 6 in base 12, or divisibility by 10 in base 10. (Also, the digital root test, where you add up the digits, works for any divisor that is also a divisor of the base minus 1, so for example hexadecimal has a digital root test for divisibility by 3, 5,…

And the less well known "add and subtract alternative digits" works for dividing by 11, that is, the base plus one, in any base. And for any divisors of 11.

You mean any divisors of [base + 1], right?

Re: Any positive number can be written as a sum of three palindromes

#86

For those who are not impressed when they enter "3" and "444", try something like "8239419503490293592", and prepare to be blown away.

I figured it had small cases down so I immediately went for a fifteen digit number from /dev/urandom and was happy that it solved it perfectly. But I'm probably the exception.

For those wondering how to generate random numbers, it's simple if you don't care about a little computational overhead: To explain the command: we read urandom into tr's stdin; tr translates (like "echo haha | tr a u"); with -d, tr deletes instead of substituting; with -c, it takes the compliment set (so everything except what you specify). Basically we're filtering characters or of urandom's output. Finally, we limit the output to a certain number of characters.

Re: Any positive number can be written as a sum of three palindromes

#88
post #78

Earlier quoted context omitted.

And according to the Numberphile video ( https://www.youtube.com/watch?v=OKhacWQ2fCs ) there is a prior paper showing it for bases 2, 3, and 4

Not base 2. All palindromes in base 2 have a 1 in the last position, because there's a 1 in the first position. This means that any addition of 3 palindromes must be odd because the result of the addition is guaranteed a 1 in the ones position, meaning even numbers can't possibly be represented that way. This is discussed in the original paper at the bottom of the second page: https://arxiv.org/pdf/1602.06208.pdf , w…

This site uses 0.

Re: Any positive number can be written as a sum of three palindromes

#89
post #86

For those who are not impressed when they enter "3" and "444", try something like "8239419503490293592", and prepare to be blown away.

I figured it had small cases down so I immediately went for a fifteen digit number from /dev/urandom and was happy that it solved it perfectly. But I'm probably the exception. For those wondering how to generate random numbers, it's simple if you don't care about a little computational overhead: To explain the command: we read urandom into tr's stdin; tr translates (like "echo haha | tr a u"); with -d, tr deletes ins…

The paper gives a detailed algorithm to provide 3 palindrome that add up to the number. The algorithm has tons of cases, but it's actually pretty simple. They work through a couple in the video.

It's a cool result.

Re: Any positive number can be written as a sum of three palindromes

#90
post #73

Earlier quoted context omitted.

And the less well known "add and subtract alternative digits" works for dividing by 11, that is, the base plus one, in any base. And for any divisors of 11.

You mean any divisors of [base + 1], right?

Yes.
Post reply on HN