OFFSET
1,3
COMMENTS
Express n in binary, then a(n) is the larger of the number of 0's and the number of 1's.
LINKS
FORMULA
EXAMPLE
a(17) = 3 because 17 in binary is 10001, which has three 0's and two 1's.
MATHEMATICA
a[n_] := Max @@ DigitCount[n, 2]; Array[a, 100] (* Amiram Eldar, Jul 29 2023 *)
PROG
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Frank Ruskey, Dec 11 2008
STATUS
approved