login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A052036 Smallest number that must be added to n to make or keep n palindromic. 3
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,13
LINKS
P. De Geest, World!Of Numbers
FORMULA
a(n)=0 iff n is in A002113, otherwise a(n)=A052037(n)-1. - M. F. Hasler, Apr 26 2014
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
Sequence in context: A259567 A022966 A023452 * A304622 A178914 A143473
KEYWORD
nonn,base,easy
AUTHOR
Patrick De Geest, Dec 15 1999
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 00:27 EDT 2024. Contains 371696 sequences. (Running on oeis4.)