OFFSET
0,13
LINKS
P. De Geest, World!Of Numbers
FORMULA
EXAMPLE
If n = 13 we need to add 9 to arrive at palindrome 22.
MATHEMATICA
snpal[n_]:=Module[{k=0, idn}, While[idn=IntegerDigits[n+k]; idn != Reverse[ idn], k++]; k]; Array[snpal, 100, 0] (* Harvey P. Dale, Nov 27 2012 *)
PROG
(PARI) a(n)=for(k=0, 9e19, is_A002113(n+k)&&return(k)) \\ For illustrative purpose only, inefficient for most large numbers. - M. F. Hasler, Apr 26 2014
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Patrick De Geest, Dec 15 1999
STATUS
approved