A131544
Least power of 3 having exactly n consecutive 9's in its decimal representation.
Original entry on oeis.org
2, 34, 35, 276, 1520, 2342, 8882, 32313, 164065, 265693, 1123487, 2421341, 6250773, 9995032, 68353789, 78927182
Offset: 1
a(3)=35 because 3^35 (i.e., 50031545098999707) is the smallest power of 3 to contain a run of 3 consecutive nines in its decimal form.
-
a = ""; Do[ a = StringJoin[a, "9"]; b = StringJoin[a, "9"]; k = 1; While[ StringPosition[ ToString[3^k], a] == {} || StringPosition[ ToString[3^k], b] != {}, k++ ]; Print[k], {n, 1, 10} ]
-
def A131544(n):
m, s = 1, '9'*n
for i in range(1,10**9):
m *= 3
if s in str(m):
return i
return "search limit reached." # Chai Wah Wu, Dec 11 2014
A131546
Least power of 3 having exactly n consecutive 7's in its decimal representation.
Original entry on oeis.org
3, 11, 112, 184, 721, 3520, 6643, 12793, 67448, 208380, 364578, 1123485, 9549790, 23340555, 88637856
Offset: 1
a(2) = 11 because 3^11 = 177147 is the smallest power of 3 to contain a run of two consecutive 7's in its decimal form.
-
a = ""; Do[ a = StringJoin[a, "7"]; b = StringJoin[a, "7"]; k = 1; While[ StringPosition[ ToString[3^k], a] == {} || StringPosition[ ToString[3^k], b] != {}, k++ ]; Print[k], {n, 10} ]
-
import sys
sys.set_int_max_str_digits(1000000)
def A131546(n):
str7 = '7'*n
x, exponent = 3, 1
while not str7 in str(x):
exponent += 1
x *= 3
return exponent # Chai Wah Wu, Aug 05 2014
A131552
Least positive power of 3 having exactly n consecutive 1's in its decimal representation.
Original entry on oeis.org
4, 19, 93, 334, 841, 3404, 7271, 7720, 44152, 406774, 993948, 2421339, 8786439, 11387707, 93548200
Offset: 1
a(3)=93 because 3^93 (i.e., 235655016338368235499067731945871638181119123) is the smallest power of 3 to contain a run of 3 consecutive ones in its decimal form.
-
a = ""; Do[ a = StringJoin[a, "1"]; b = StringJoin[a, "1"]; k = 1; While[ StringPosition[ ToString[3^k], a] == {} || StringPosition[ ToString[3^k], b] != {}, k++ ]; Print[k], {n, 1, 10} ]
-
def A131552(n):
m, s = 1, '1'*n
for i in range(1, 10**9):
m *= 3
if s in str(m):
return i
return "search limit reached." # Chai Wah Wu, Dec 11 2014
A131545
Least k such that 3^k has exactly n consecutive 8's in its decimal representation.
Original entry on oeis.org
4, 23, 32, 215, 1261, 538, 4797, 17612, 32311, 375482, 512959, 1847532, 8295710, 8885853, 80798025
Offset: 1
a(3)=32 because 3^32 (i.e., 1853020188851841) is the smallest power of 3 to contain a run of 3 consecutive eights in its decimal form.
-
a = ""; Do[ a = StringJoin[a, "8"]; b = StringJoin[a, "8"]; k = 1; While[ StringPosition[ ToString[3^k], a] == {} || StringPosition[ ToString[3^k], b] != {}, k++ ]; Print[k], {n, 1, 10} ]
A131547
Least power of 3 having exactly n consecutive 6's in its decimal representation.
Original entry on oeis.org
8, 33, 34, 275, 1385, 539, 8881, 22792, 90785, 107188, 704996, 1847533, 5756980, 9995031, 68353788
Offset: 1
a(3)=34 because 3^34(i.e. 16677181699666569) is the smallest power of 3 to contain a run of 3 consecutive sixes in its decimal form.
-
a = ""; Do[ a = StringJoin[a, "6"]; b = StringJoin[a, "6"]; k = 1; While[ StringPosition[ ToString[3^k], a] == {} || StringPosition[ ToString[3^k], b] != {}, k++ ]; Print[k], {n, 1, 10} ]
A131548
Least power of 3 having a run of exactly n consecutive 5's in its decimal representation.
Original entry on oeis.org
8, 27, 33, 33, 274, 2076, 5173, 8880, 67390, 206131, 864271, 1291676, 5756979, 13654248, 73000220
Offset: 1
a(3) = 33 because 3^33 = 5559060566555523 is the smallest power of 3 that contains a run of exactly 3 consecutive 5's in its decimal form. (3^33 happens to contain also a run of exactly 4 consecutive 5's, so a(4) is also 33.)
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
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.
-
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} ]
-
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
A131550
a(n) is the least exponent e such that 3^e has exactly n consecutive 3's in its decimal representation.
Original entry on oeis.org
1, 31, 119, 185, 511, 2341, 9671, 7721, 67449, 364579, 513334, 639227, 6250772, 30377688, 82011443, 78927181
Offset: 1
a(3)=119 because 3^119 (i.e., 599003433304810403471059943169868346577158542512617035467) is the smallest power of 3 to contain a run of 3 consecutive threes in its decimal form.
-
a = ""; Do[ a = StringJoin[a, "3"]; b = StringJoin[a, "3"]; k = 1; While[ StringPosition[ ToString[3^k], a] == {} || StringPosition[ ToString[3^k], b] != {}, k++ ]; Print[k], {n, 1, 10} ]
A131551
Least power of 3 having exactly n consecutive 2's in its decimal representation.
Original entry on oeis.org
3, 19, 148, 253, 330, 2380, 2124, 30598, 22791, 238582, 107187, 1521134, 10363119, 9995030, 68353787
Offset: 1
a(3)=148 because 3^148 (i.e. 41109831670569663658300086939077404909608122265524774868353822811305361) is the smallest power of 3 to contain a run of 3 consecutive twos in its decimal form.
-
a = ""; Do[ a = StringJoin[a, "2"]; b = StringJoin[a, "2"]; k = 1; While[ StringPosition[ ToString[3^k], a] == {} || StringPosition[ ToString[3^k], b] != {}, k++ ]; Print[k], {n, 1, 10} ]
-
def a(n):
k, n2, np2 = 1, '2'*n, '2'*(n+1)
while True:
while not n2 in str(3**k): k += 1
if np2 not in str(3**k): return k
k += 1
print([a(n) for n in range(1, 8)]) # Michael S. Branicky, Mar 19 2021
A329172
a(n) is the least positive exponent k such that the decimal expansion of 5^k contains n consecutive zeros.
Original entry on oeis.org
1, 8, 39, 67, 228, 1194, 3375, 10052, 19699, 26563, 26566, 922553
Offset: 0
5^1 = 5 is the first power of 5 that has no zero, so a(0) = 1.
5^8 = 390625 is the first power of 5 that has 1 zero, so a(1) = 8.
5^39 = 1818989403545856475830078125 is the first power of 5 that has 2 consecutive zeros, so a(2) = 39.
-
Print[1]; zero = {}; Do[zero = zero <> "0"; k = 1; While[StringPosition[ToString[5^k], zero] == {}, k++]; Print[k];, {n, 1, 10}] (* Vaclav Kotesovec, Nov 07 2019 *)
-
isok(k, n) = {my(d = digits(5^k), pz = select(x->(x==0), d)); if (n<=1, return (#pz == n)); if (#pz < n, return (0)); my(c=0, ok=0, kc=0); for (i=1, #d, if (d[i] == 0, ok = 1; if (ok, c++), if (c > kc, kc=c); ok = 0; c = 0);); kc == n;}
a(n) = my(k=1); while (!isok(k, n), k++); k;
-
upto(n) = {my(p5 = 5, res = List()); for(i = 1, n, c = qconsecutivezeros(p5); for(j = #res, c, listput(res, i); print1(i", "); ); p5 *= 5 ); res }
qconsecutivezeros(n) = { my(d = digits(n), streak = 0, res = 0); for(i = 1, #d, if(d[i] == 0, streak++ , res = max(streak, res); streak = 0 ) ); res } \\ David A. Corneth, Nov 07 2019
Showing 1-10 of 11 results.
Comments