OFFSET
0,12
LINKS
MATHEMATICA
a[n_] := Module[{k = 1}, While[! PalindromeQ[n + k] && ! PalindromeQ[n - k], k++]; k]; Table[a[n], {n, 0, 100}]
PROG
(PARI) a(n)={my(ispal=v->v==Vecrev(v)); for(k=1, oo, if(ispal(digits(n+k)) || ispal(digits(n-k)), return(k)))} \\ Andrew Howroyd, Aug 23 2019
CROSSREFS
KEYWORD
AUTHOR
Ilya Gutkovskiy, Aug 23 2019
STATUS
approved