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.

A065712 Number of 1's in decimal expansion of 2^n.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Dec 04 2001

Keywords

Comments

I conjecture that any value x = 0, 1, 2, ... occurs only a finite number of times N(x) = 26, 34, 30, 40, 26, 33, 39, 30, 30, 30, 38, ... in this sequence, for the last time at well defined indices i(x) = 91, 152, 185, 412, 245, 505, 346, 422, 499, 565, 529, 575, ... - M. F. Hasler, Jul 09 2025

Examples

			2^17 = 131072 so a(17) = 2.
		

Crossrefs

Cf. A027870 (0's), A065710 (2's), A065714 (3's), A065715 (4's), A065716 (5's), A065717 (6's), A065718 (7's), A065719 (8's), A065744 (9's).
Indices of zeros are listed in A035057 (2^n does not contain the digit 1).

Programs

  • Mathematica
    Table[ Count[ IntegerDigits[2^n], 1], {n, 0, 100} ]
    Table[DigitCount[2^n,10,1],{n,0,120}] (* Harvey P. Dale, Aug 15 2014 *)
  • PARI
    a(n) = #select(x->(x==1), digits(2^n)); \\ Michel Marcus, Jun 15 2018
    
  • Python
    def A065712(n):
        return str(2**n).count('1') # Chai Wah Wu, Feb 14 2020

Extensions

More terms from Robert G. Wilson v, Dec 07 2001