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.

A046818 Number of 1's in binary expansion of 3n+1.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Cf. A000120, A016777 (3n+1).

Programs

  • Haskell
    a046818 = a000120 . a016777  -- Reinhard Zumkeller, Apr 14 2014
  • Mathematica
    Table[Count[IntegerDigits[3 n + 1, 2], 1], {n, 0, 92}] (* Jayanta Basu, Jun 29 2013 *)
    DigitCount[#,2,1]&/@(3Range[0,100]+1) (* Harvey P. Dale, Apr 03 2021 *)

Formula

a(n) = A000120(3n+1).
a(n) = A240883(n) + 1. - Reinhard Zumkeller, Apr 14 2014