login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A132680
Number of ones in binary representation of odious numbers.
5
1, 1, 1, 3, 1, 3, 3, 3, 1, 3, 3, 3, 3, 3, 3, 5, 1, 3, 3, 3, 3, 3, 3, 5, 3, 3, 3, 5, 3, 5, 5, 5, 1, 3, 3, 3, 3, 3, 3, 5, 3, 3, 3, 5, 3, 5, 5, 5, 3, 3, 3, 5, 3, 5, 5, 5, 3, 5, 5, 5, 5, 5, 5, 7, 1, 3, 3, 3, 3, 3, 3, 5, 3, 3, 3, 5, 3, 5, 5, 5, 3, 3, 3, 5, 3, 5, 5, 5, 3, 5, 5, 5, 5, 5, 5, 7, 3, 3, 3, 5, 3, 5, 5, 5, 3
OFFSET
1,4
LINKS
Eric Weisstein's World of Mathematics, Odious Number.
Eric Weisstein's World of Mathematics, Thue-Morse Sequence.
FORMULA
a(n) = a(floor(n/2)) + 2*(n mod 2)*(1-A010060(n)).
a(n) = A000120(A000069(n)).
a(A129771(n)) = a((A129771(n)-1)/2) + 2.
a(A083420(n)) = A005408(n).
MATHEMATICA
Select[DigitCount[Range[200], 2, 1], OddQ] (* Amiram Eldar, Jul 22 2023 *)
PROG
(PARI) a(n)=hammingweight(2*n-1-hammingweight(n-1)%2) \\ Charles R Greathouse IV, Mar 26 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, Aug 26 2007
STATUS
approved