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.

A266161 Hamming weights of A266089.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Dec 22 2015

Keywords

Crossrefs

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 *)

Formula

a(n) = A000120(A266089(n)).
abs(a(n+1) - a(n)) = 1 by definition of A266089.
For n > 0: a(A140253(n)) = n and a(m) < n for m < A140253(n).