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!)
A043261 Sum of the binary digits of the n-th base-2 palindrome. 1
0, 1, 2, 2, 3, 2, 4, 2, 3, 4, 5, 2, 4, 4, 6, 2, 3, 4, 5, 4, 5, 6, 7, 2, 4, 4, 6, 4, 6, 6, 8, 2, 3, 4, 5, 4, 5, 6, 7, 4, 5, 6, 7, 6, 7, 8, 9, 2, 4, 4, 6, 4, 6, 6, 8, 4, 6, 6, 8, 6, 8, 8, 10, 2, 3, 4, 5, 4, 5, 6, 7, 4, 5, 6, 7, 6, 7, 8, 9, 4, 5, 6, 7, 6, 7, 8, 9, 6, 7, 8 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
FORMULA
Let b(1) = 0, b(2) = 1, otherwise b(2*n-1) = b(n-1) and b(2*n) = b(n).
Let c(1) = 0, c(2) = 1, otherwise c(2*n-1) = c(n-1)+1 and c(2*n) = c(n).
Then for n >= 2, a(2*n-1) = 2*c(2*n-1) - b(2*n-1) and a(2*n) = 2*c(2*n).
EXAMPLE
The fourth base-2 palindrome is 5 = 101_2, so a(4) = 1+0+1 = 2.
MAPLE
b:= proc(n) option remember;
procname(floor(n/2)) end proc;
b(1):= 0; b(2):= 1;
c:= proc(n) option remember;
procname(floor(n/2)) + (n mod 2) end proc;
c(1):= 0; c(2):= 1;
A043261:= n -> 2*c(n) - (n mod 2)*b(n);
A043261(2):= 1; # Robert Israel, Apr 06 2014
CROSSREFS
Cf. A006995 (base-2 palindromes), A057148.
Sequence in context: A334762 A358040 A305461 * A157986 A025479 A079243
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
edited by Robert Israel, Apr 06 2014
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 19 23:15 EDT 2024. Contains 371798 sequences. (Running on oeis4.)