OFFSET
1,9
COMMENTS
LINKS
EXAMPLE
a(35) = 3, since 35 in binary is 100011.
MATHEMATICA
Table[Min[DigitCount[n, 2, 1], DigitCount[n, 2, 0]], {n, 70}] (* Harvey P. Dale, May 09 2012 *)
PROG
(Haskell)
a152723 n = min (a000120 n) (a023416 n)
-- Reinhard Zumkeller, Mar 31 2015
(PARI) a(n) = my(x=hammingweight(n)); min(x, #binary(n) - x); \\ Michel Marcus, Mar 30 2020
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Frank Ruskey, Dec 11 2008
STATUS
approved