The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A303534 Amount by which n exceeds the largest binary palindrome less than or equal to n. 2
0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 3, 4, 5, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,12
LINKS
FORMULA
a(n) = n - A206913(n).
EXAMPLE
The largest binary palindrome that doesn't exceed 30 is 27 (11011 r2). 30 - 27 = 3, so a(30) = 3.
PROG
(PARI) isA006995(n) = Vecrev(n=binary(n))==n;
a(n) = {my(k=0); while(!isA006995(n-k), k++); k; } \\ Altug Alkan, Apr 25 2018
CROSSREFS
A006995 lists the binary palindromes.
A206913 gives the largest binary palindrome that does not exceed n.
Cf. also A261424 (analog in base 10), A280506, A303536.
Sequence in context: A037884 A347728 A336206 * A369183 A030567 A049265
KEYWORD
nonn,easy,base,look
AUTHOR
Allan C. Wechsler, Apr 25 2018
EXTENSIONS
More terms from Altug Alkan, Apr 25 2018
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 May 24 17:36 EDT 2024. Contains 372781 sequences. (Running on oeis4.)