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

%I #21 May 13 2018 07:38:01

%S 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,

%T 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,

%U 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

%N Amount by which n exceeds the largest binary palindrome less than or equal to n.

%H Antti Karttunen, <a href="/A303534/b303534.txt">Table of n, a(n) for n = 0..65537</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%F a(n) = n - A206913(n).

%e The largest binary palindrome that doesn't exceed 30 is 27 (11011 r2). 30 - 27 = 3, so a(30) = 3.

%o (PARI) isA006995(n) = Vecrev(n=binary(n))==n;

%o a(n) = {my(k=0); while(!isA006995(n-k), k++); k;} \\ _Altug Alkan_, Apr 25 2018

%Y A006995 lists the binary palindromes.

%Y A206913 gives the largest binary palindrome that does not exceed n.

%Y Cf. also A261424 (analog in base 10), A280506, A303536.

%K nonn,easy,base,look

%O 0,12

%A _Allan C. Wechsler_, Apr 25 2018

%E More terms from _Altug Alkan_, Apr 25 2018

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 June 16 18:56 EDT 2024. Contains 373432 sequences. (Running on oeis4.)