%I #12 Jul 29 2023 03:16:16
%S 1,1,2,2,2,2,3,3,2,2,3,2,3,3,4,4,3,3,3,3,3,3,4,3,3,3,4,3,4,4,5,5,4,4,
%T 3,4,3,3,4,4,3,3,4,3,4,4,5,4,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,6,5,5,4,5,
%U 4,4,4,5,4,4,4,4,4,4,5,5,4,4,4,4,4,4,5
%N In binary, count of most frequent bit of n.
%C Express n in binary, then a(n) is the larger of the number of 0's and the number of 1's.
%H Reinhard Zumkeller, <a href="/A152724/b152724.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>.
%F a(n) = max( A000120(n), A023416(n) ).
%F a(n) + A152723(n) = 1 + floor(log_2(n)).
%F a(n) = A070939(n) - A152723(n). - _Reinhard Zumkeller_, Mar 31 2015
%e a(17) = 3 because 17 in binary is 10001, which has three 0's and two 1's.
%t a[n_] := Max @@ DigitCount[n, 2]; Array[a, 100] (* _Amiram Eldar_, Jul 29 2023 *)
%o (Haskell)
%o a152724 n = max (a000120 n) (a023416 n)
%o -- _Reinhard Zumkeller_, Mar 31 2015
%Y Cf. A000120, A023416, A070939, A152723.
%K base,easy,nonn
%O 1,3
%A _Frank Ruskey_, Dec 11 2008