A131540
Exponent of least power of 2 having exactly n consecutive 6's in its decimal representation.
Original entry on oeis.org
0, 4, 46, 157, 222, 220, 2269, 11019, 18842, 192918, 192916, 271979, 1039316, 7193133, 14060686, 97428976
Offset: 0
a(3)=157 because 2^157(i.e. 182687704666362864775460604089535377456991567872) is the smallest power of 2 to contain a run of 3 consecutive sixes in its decimal form.
- Popular Computing (Calabasas, CA), Two Tables, Vol. 1, (No. 9, Dec 1973), page PC9-16.
-
a = ""; Do[ a = StringJoin[a, "6"]; b = StringJoin[a, "6"]; k = 1; While[ StringPosition[ ToString[2^k], a] == {} || StringPosition[ ToString[2^k], b] != {}, k++ ]; Print[k], {n, 1, 10} ]
A131541
Exponent of least power of 2 having exactly n consecutive 7's in its decimal representation.
Original entry on oeis.org
0, 15, 27, 24, 181, 317, 2309, 972, 25264, 131979, 279275, 279269, 1727605, 6030752, 8760853, 77235364
Offset: 0
a(3)=24 because 2^24(i.e. 16777216) is the smallest power of 2 to contain a run of 3 consecutive sevens in its decimal form.
- Popular Computing (Calabasas, CA), Two Tables, Vol. 1, (No. 9, Dec 1973), page PC9-16.
-
a = ""; Do[ a = StringJoin[a, "7"]; b = StringJoin[a, "7"]; k = 1; While[ StringPosition[ ToString[2^k], a] == {} || StringPosition[ ToString[2^k], b] != {}, k++ ]; Print[k], {n, 1, 10} ]
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
A329174
a(n) is the least positive exponent k such that the decimal expansion of 7^k contains n consecutive zeros.
Original entry on oeis.org
1, 4, 20, 74, 154, 499, 510, 4411, 6984, 33836, 61282, 709339, 1570651
Offset: 0
7^20 = 79792266297612001 is the first power of 7 that has 2 consecutive zeros, so a(2) = 20.
7^74 = 344552147465294110719732986332367243247925798357929806000836849 is the first power of 7 that has 3 consecutive zeros, so a(3) = 74.
-
Print[1]; zero = {}; Do[zero = zero <> "0"; k = 1; While[StringPosition[ToString[7^k], zero] == {}, k++]; Print[k];, {n, 1, 10}]
Comments