login
A319387
Smallest palindrome p such that n-p is again a palindrome, or n if no such p exists.
1
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 21, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 32, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 43, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 54, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 65, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 76, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 87, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 98, 0
OFFSET
0,14
COMMENTS
a(n) = n if and only if A262087(n) = 0.
LINKS
EXAMPLE
a(11) = 0 because 11 = 11 + 0, so 0 is the smallest palindrome in any partitioning of 11 as a sum of two palindromes.
a(21) = 21 because 21 cannot be written as a sum of two palindromes.
MAPLE
isP := k -> StringTools[IsPalindrome](convert(k, string)):
a := NULL:
for n from 0 to 99 do
an := n:
for k from 0 to n/2 do
if isP(k) and isP(n-k) then an := min(an, k) end if
end do:
a := a, an
end do:
a;
CROSSREFS
KEYWORD
nonn,base,look
AUTHOR
Markus Sigg, Sep 18 2018
STATUS
approved