A329172 a(n) is the least positive exponent k such that the decimal expansion of 5^k contains n consecutive zeros.
1, 8, 39, 67, 228, 1194, 3375, 10052, 19699, 26563, 26566, 922553
Offset: 0
Examples
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.
Links
- O. M. Cain, The Exceptional Selfcondensability of Powers of Five, arXiv:1910.13829 [math.HO], 2019.
Crossrefs
Programs
-
Mathematica
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 *)
-
PARI
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;
-
PARI
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
Extensions
a(9)-a(10) from David A. Corneth, Nov 07 2019
a(11) from Vaclav Kotesovec, Nov 08 2019
Comments