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.

A143903 A positive integer k is included if |(number of 0's in binary k) - (number of 1's in binary k)| divides k.

Original entry on oeis.org

1, 4, 5, 6, 8, 14, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 30, 32, 34, 36, 40, 46, 48, 54, 58, 60, 66, 67, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 92, 93, 95, 96, 97, 98, 99, 100, 101, 102, 104, 105, 106, 108, 112, 113, 114, 116
Offset: 1

Views

Author

Leroy Quet, Sep 04 2008

Keywords

Examples

			27 in binary is 11011. The number of 0's is 1. The number of 1's is 4. Since |1-4|=3 divides 27, 27 is a term of the sequence.
		

Crossrefs

Cf. A037861.

Programs

  • Mathematica
    Select[Range[100], Abs[DigitCount[ #, 2, 1] - DigitCount[ #, 2, 0]] > 0 && Mod[ #, Abs[DigitCount[ #, 2, 1] - DigitCount[ #, 2, 0]]] == 0 &] (* Stefan Steinerberger, Sep 05 2008 *)

Extensions

More terms from Stefan Steinerberger, Sep 05 2008