3 ms·
It's easier to find more than fewer palindromes that when summed up will give a certain number. Finding just the three, is not that easy.
by jarfil 8y ago
It's easier to find more than fewer palindromes that when summed up will give a certain number. Finding just the three, is not that easy.
- madcaptenor 8y agoAnd just to clarify, the greedy algorithm (take the largest palindrome less than the number you're trying to express) doesn't work. To take a random nine-digit example (literally the first one I tried): 635932028 = 635929536 + 2442 + 44 + 6. In general you can express N as a sum of something like log(log(N)) palindromes this way, which is not quite constant.