login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A309932 Distance from n to closest palindrome that is different from n. 1
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 11, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 11, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 11, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 11, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 11, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 11, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 11, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 2, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,12

LINKS

David A. Corneth, Table of n, a(n) for n = 0..9999

Index entries for sequences related to distance to nearest element of some set

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

Cf. A002113, A100771.

Sequence in context: A125932 A175793 A244789 * A058886 A236858 A220661

Adjacent sequences:  A309929 A309930 A309931 * A309933 A309934 A309935

KEYWORD

nonn,base,look

AUTHOR

Ilya Gutkovskiy, Aug 23 2019

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 27 09:08 EDT 2020. Contains 338035 sequences. (Running on oeis4.)