A266161 Hamming weights of A266089.
0, 1, 2, 1, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2, 3, 4, 3, 4, 3, 4, 5, 4, 3, 2, 1, 2, 3, 2, 3, 2, 3, 4, 3, 4, 3, 4, 5, 4, 3, 2, 3, 4, 3, 4, 5, 4, 3, 4, 5, 4, 5, 6, 5, 4, 3, 2, 1, 2, 3, 2, 3, 2, 3, 4, 3, 4, 3, 4, 5, 4, 3, 2, 3, 4, 3
Offset: 0
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
Programs
-
Haskell
a266161 = a000120 . a266089
-
Mathematica
s[0] = 0; s[n_] := s[n] = Module[{bw = DigitCount[s[n - 1], 2, 1], k = 1}, While[!FreeQ[Array[s, n - 1], k] || Abs[DigitCount[k, 2, 1] - bw] != 1, k++]; k]; DigitCount[Array[s, 100, 0], 2, 1] (* Amiram Eldar, Jul 18 2023 *)