

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
(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 0s and the number of 1s;
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


LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Index entries for sequences related to binary expansion of n


EXAMPLE

a(17) = 3 because 17 in binary is 10001, which has 3 0s and 2 1s.


PROG

(Haskell)
a152724 n = max (a000120 n) (a023416 n)
 Reinhard Zumkeller, Mar 31 2015


CROSSREFS

Cf. A000120, A023416, A070939, A152723.
Sequence in context: A322665 A273632 A196046 * A081743 A247069 A322168
Adjacent sequences: A152721 A152722 A152723 * A152725 A152726 A152727


KEYWORD

base,easy,nonn


AUTHOR

Frank Ruskey, Dec 11 2008


STATUS

approved



