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.

A356876 Binary weight of the composite numbers (A002808).

Original entry on oeis.org

1, 2, 1, 2, 2, 2, 3, 4, 1, 2, 2, 3, 3, 2, 3, 3, 4, 3, 4, 1, 2, 2, 3, 2, 3, 4, 2, 3, 3, 4, 4, 2, 3, 3, 4, 3, 4, 5, 3, 4, 4, 4, 5, 6, 1, 2, 2, 2, 3, 3, 2, 3, 4, 3, 4, 4, 2, 3, 3, 3, 4, 4, 5, 3, 4, 5, 4, 5, 5, 6, 2, 3, 4, 3, 4, 3, 4, 4, 4, 5, 6, 3, 4, 5, 4, 5, 5, 6, 4, 5, 5
Offset: 1

Views

Author

Karl-Heinz Hofmann, Oct 02 2022

Keywords

Crossrefs

Programs

  • Mathematica
    DigitCount[#, 2, 1] & /@ Select[Range[125], CompositeQ] (* Amiram Eldar, Oct 03 2022 *)
  • PARI
    forcomposite (k=0, 120, print1 (hammingweight(k),", ")) \\ Hugo Pfoertner, Oct 03 2022
  • Python
    from sympy import isprime
    print([bin(k)[2:].count("1") for k in range(4, 123) if not isprime(k)])
    

Formula

a(n) = A000120(A002808(n)).