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.

This page as a plain text file.
%I A131549 #21 May 12 2021 19:08:20
%S A131549 5,12,55,308,510,2340,7286,9670,125406,222961,847169,639226,6250771,
%T A131549 14929721
%N A131549 Least exponent k such that 3^k has exactly n consecutive 4's in its decimal representation.
%C A131549 a(15) > 10^8, a(16)=82011442, a(17)=78927180. - _Bert Dobbelaere_, Mar 20 2019
%e A131549 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.
%t A131549 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} ]
%o A131549 (Python)
%o A131549 def a(n):
%o A131549   target, antitarget = '4'*n, '4'*(n+1)
%o A131549   k, pow3 = 1, 3
%o A131549   while True:
%o A131549     t = str(pow3)
%o A131549     if target in t and antitarget not in t: return k
%o A131549     k, pow3 = k+1, pow3*3
%o A131549 print([a(n) for n in range(1, 9)]) # _Michael S. Branicky_, May 12 2021
%Y A131549 Cf. A195269, A131552, A131551, A131550, A131548, A131547, A131546, A131545, A131544.
%K A131549 more,nonn,base
%O A131549 1,1
%A A131549 _Shyam Sunder Gupta_, Aug 26 2007
%E A131549 a(11)-a(14) from _Lars Blomberg_, Feb 02 2013