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!)
A152723 In binary, count of least frequent bit of n. 2
0, 1, 0, 1, 1, 1, 0, 1, 2, 2, 1, 2, 1, 1, 0, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 1, 0, 1, 2, 2, 3, 2, 3, 3, 2, 2, 3, 3, 2, 3, 2, 2, 1, 2, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,9
COMMENTS
Express n in binary, then a(n) is the smaller of the number of 0's and the number of 1's;
a(n) = min( A000120(n), A023416(n) );
a(n) + A152724(n) = 1 + floor(log[2](n)).
a(n) = A070939(n) - A152724(n). - Reinhard Zumkeller, Mar 31 2015
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
Cf. A092431 (positions of records).
Sequence in context: A085906 A221649 A090406 * A237497 A281191 A324496
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 08:27 EDT 2024. Contains 371769 sequences. (Running on oeis4.)