cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A066879 n such that there are as many 1's as 0's in the base 2 expansion of Floor(n/2).

Original entry on oeis.org

4, 5, 18, 19, 20, 21, 24, 25, 70, 71, 74, 75, 76, 77, 82, 83, 84, 85, 88, 89, 98, 99, 100, 101, 104, 105, 112, 113, 270, 271, 278, 279, 282, 283, 284, 285, 294, 295, 298, 299, 300, 301, 306, 307, 308, 309, 312, 313, 326, 327, 330, 331, 332, 333, 338, 339, 340
Offset: 1

Views

Author

Joseph L. Pe, Jan 21 2002

Keywords

Comments

n such that there are as many odd as even terms in the orbit f(n), f(f(n)), f(f(f(n))), ..., 1, where f(k) = Floor(k/2).

Examples

			floor(18/2) = 9 = 1001 (base 2) has the same number of 1's as 0's. So 18 is a term of the sequence.
Also the orbit corresponding to 18 is 9, 4, 2, 1, which has an equal number (i.e. 2) of odd and even terms.
		

Crossrefs

Complement is the union of 1 and A126388.

Programs

  • Mathematica
    Select[Range[500],DigitCount[Floor[#/2],2,1]==DigitCount[Floor[#/2],2,0]&] (* Harvey P. Dale, Jan 14 2014 *)

Formula

A037861(Floor(n/2)) = 0.

Extensions

Extended and edited by John W. Layman, Jan 30 2002
New definition by Jonathan Sondow, Jun 10 2011