login
A131549
Least exponent k such that 3^k has exactly n consecutive 4's in its decimal representation.
9
5, 12, 55, 308, 510, 2340, 7286, 9670, 125406, 222961, 847169, 639226, 6250771, 14929721
OFFSET
1,1
COMMENTS
a(15) > 10^8, a(16)=82011442, a(17)=78927180. - Bert Dobbelaere, Mar 20 2019
EXAMPLE
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.
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} ]
PROG
(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
KEYWORD
more,nonn,base
AUTHOR
Shyam Sunder Gupta, Aug 26 2007
EXTENSIONS
a(11)-a(14) from Lars Blomberg, Feb 02 2013
STATUS
approved