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.

A065714 Number of 3's in decimal expansion of 2^n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 3, 0, 1, 1, 1, 1, 1, 0, 1, 0, 4, 1, 3, 0, 1, 0, 1, 1, 1, 0, 3, 1, 3, 0, 2, 0, 1, 2, 0, 1, 2, 2, 0, 2, 3, 0, 4, 1, 3, 1, 4, 2, 1, 1, 1, 2, 3, 2, 3, 1, 2, 4, 1, 4, 3, 0, 3, 2, 3, 4, 4, 3, 3, 2, 1, 3, 0, 0, 4, 2, 2, 6, 1, 4, 4, 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) = 34, 34, 24, 34, 39, 34, 35, 34, 35, 32, 33, 31, ... in this sequence, for the last time at well defined indices i(x) = 153, 139, 226, 237, 308, 386, 413, 506, 461, 578, 644, 732, 857, 657, 743, 768, 784, 848, 906, ... - M. F. Hasler, Jul 09 2025

Examples

			2^5 = 32 so a(5)=1.
		

Crossrefs

Cf. A000079 (powers of 2), A035058 (2^n does not contain the digit 3).
Similar for other digits: A027870 (0's), A065712 (1's), A065710 (2's), this (3's), A065715 (4's), A065716 (5's), A065717 (6's), A065718 (7's), A065719 (8's), A065744 (9's).
Cf. A094776 (index of last occurrence of digit n in powers of 2).

Programs

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

Extensions

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