Live data from Hacker News

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

somethingorotherwhatever.com

51–60 of 114 posts

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

#51
It seems to go for the "least interesting" result. eg: I gave it 363 and it gave me back 363 + 0 + 0, which while technically true, 121 + 121 + 121 would have been more in the spirit of it, IMO. Or even 242 + 121 + 0 would be a little easier than just reusing the original palindrome number with zeros.

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

#52

For those wondering, this works in every base ≥ 5, according to the original paper: https://arxiv.org/abs/1602.06208v2 Every time I see something like this that is dependent on base-10 representation, I'm always curious to know whether it generalizes, or if it's a quirk specific to base-10 representation. For example, being able to tell if a number is divisible by 2 or 5 by only looking at the last digit.

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

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

#54

i'm underwhelmed 77777777777777 +0 +0 =77777777777777

I got 10,067,892,461 = 9,910,110,199 + 144,959,441 + 12,822,821, which I think is pretty impressive.

Ah that is neat. For most smaller numbers, it seems to use 0 a lot, which is not interesting. But your example is the first one I saw that didn't include 0.

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

#56

Could this trick be used to improve compression? Since palindromes contain repeated digits by definition, perhaps they are more compressible than the original number? Of course, you'd have three numbers to compress instead of one...

only if the two decomposed numbers together take up the same space or less as the original number. no idea in what cases that happens.

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

#57

Earlier quoted context omitted.

> Is there such a thing as "interactive nonfiction"? The real physical Universe is interactive nonfiction.

The real physical universe doesn't offer tooling for playing with advanced math, though.

Sure it does, it just takes some work to unlock it.

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

#59

For those wondering, this works in every base ≥ 5, according to the original paper: https://arxiv.org/abs/1602.06208v2 Every time I see something like this that is dependent on base-10 representation, I'm always curious to know whether it generalizes, or if it's a quirk specific to base-10 representation. For example, being able to tell if a number is divisible by 2 or 5 by only looking at the last digit.

> For example, being able to tell if a number is divisible by 2 or 5 by only looking at the last digit.

That still seems like it is generalizable to any base by taking prime factors of any base-n.

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

#60

Looks like code is at [0]. Didn't read in detail, but how difficult is it to find these 3 palindromes for something like a 100 digit number? Or, asked another way, how hard will it be to crack my new 3-palindrome-sum-factor based encryption scheme (assuming I have rules about not having easy factors)? 0 - https://github.com/christianp/sum-of-palindromes

Uniqueness would be a problem. The sum isn't guaranteed to have unique terms. 2 is (2,0,0) and (1,1,0).

I guess the next question might be then, can the upper limit for the number of potential matches be found, if no restrictions are placed on the input sequence?

Without thinking the problem through (about to sleep) I wouldn't be surprised if the answer is easily proven to be exponential (aka a firm "nope") but math can be unintuitive at times so I thought I'd ask anyway.

I ask because, if the maximum number of potential matches isn't exponential (or is at least <= 3 digits long), it might be plausible to read through the number of matches to find "interesting" (elegant-looking) ones.

Post reply on HN