A143903 A positive integer k is included if |(number of 0's in binary k) - (number of 1's in binary k)| divides k.
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
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.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
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