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!)
A152724 In binary, count of most frequent bit of n. 2
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, 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, 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 5, 5, 4, 4, 4, 4, 4, 4, 5 (list; graph; refs; listen; history; text; internal format)
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
a(n) = max( A000120(n), A023416(n) ).
a(n) + A152723(n) = 1 + floor(log_2(n)).
a(n) = A070939(n) - A152723(n). - Reinhard Zumkeller, Mar 31 2015
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
(Haskell)
a152724 n = max (a000120 n) (a023416 n)
-- Reinhard Zumkeller, Mar 31 2015
CROSSREFS
Sequence in context: A273632 A347387 A196046 * A081743 A247069 A367008
KEYWORD
base,easy,nonn
AUTHOR
Frank Ruskey, Dec 11 2008
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 18 03:29 EDT 2024. Contains 371767 sequences. (Running on oeis4.)