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.

A131549 Least exponent k such that 3^k has exactly n consecutive 4's in its decimal representation.

Original entry on oeis.org

5, 12, 55, 308, 510, 2340, 7286, 9670, 125406, 222961, 847169, 639226, 6250771, 14929721
Offset: 1

Views

Author

Shyam Sunder Gupta, Aug 26 2007

Keywords

Comments

a(15) > 10^8, a(16)=82011442, a(17)=78927180. - Bert Dobbelaere, Mar 20 2019

Examples

			a(3)=55 because 3^55 (i.e., 174449211009120179071170507) is the smallest power of 3 to contain a run of 3 consecutive fours in its decimal form.
		

Crossrefs

Programs

  • Mathematica
    a = ""; Do[ a = StringJoin[a, "4"]; b = StringJoin[a, "4"]; k = 1; While[ StringPosition[ ToString[3^k], a] == {} || StringPosition[ ToString[3^k], b] != {}, k++ ]; Print[k], {n, 1, 10} ]
  • Python
    def a(n):
      target, antitarget = '4'*n, '4'*(n+1)
      k, pow3 = 1, 3
      while True:
        t = str(pow3)
        if target in t and antitarget not in t: return k
        k, pow3 = k+1, pow3*3
    print([a(n) for n in range(1, 9)]) # Michael S. Branicky, May 12 2021

Extensions

a(11)-a(14) from Lars Blomberg, Feb 02 2013