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.

A065744 Number of 9's in the decimal expansion of 2^n.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Dec 04 2001

Keywords

Comments

See A035064 for the indices of zeros. I conjecture that any value x = 0, 1, 2, ... occurs only a finite number of times N(x) = 37, 27, 36, 46, 20, 31, 32, 30, 46, 29, 22, ... in this sequence, for the last time at well defined indices i(x) = 108, 197, 296, 277, 278, 315, 379, 555, 503, 504, 539, 696, 667, ... - M. F. Hasler, Jul 09 2025

Examples

			2^12 = 4096 so a(12)=1.
		

Crossrefs

Similar for other digits: A027870 (0's), A065712 (1's), A065710 (2's), A065714 (3's), A065715 (4's), A065716 (5's), A065717 (6's), A065718 (7's), A065719 (8's).
Cf. A035064 (2^n has no digit 9).

Programs

  • Mathematica
    Table[ Count[ IntegerDigits[2^n], 9], {n, 0, 100} ]
  • PARI
    Count(x,d)={ #select(t->t==d, digits(x)) }
    a(n) = Count(2^n, 9) \\ Harry J. Smith, Oct 27 2009
    
  • Python
    def A065744(n):
        return str(2**n).count('9')  # Chai Wah Wu, Feb 14 2020

Extensions

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