login
Least number k such that between k! and (k+1)! there are n powers of ten.
2

%I #51 Mar 09 2024 04:50:44

%S 3,14,103,1042,10158,100502,1000617,10006509,100019088,1000004377,

%T 10000170793,100000442970,1000001981666,10000005339905,

%U 100000018997256,1000000065392525,10000000201014294,100000000631520633,1000000001077349719,10000000005309690910

%N Least number k such that between k! and (k+1)! there are n powers of ten.

%H Kevin Ryde, <a href="/A084420/b084420.txt">Table of n, a(n) for n = 1..400</a>

%H Kevin Ryde, <a href="/A084420/a084420.c.txt">C code</a>.

%t LogBase10Stirling[n_] := Floor[ Log[10, 2 Pi n]/2 + n * Log[10, n/E] + Log[10, 1 + 1/(12n) + 1/(288n^2) - 139/(51840n^3) - 571/(2488320n^4) + 163879/(209018880n^5)]]; Do[k = 10^(n - 1); While[ LogBase10Stirling[k + 1] - LogBase10Stirling[k] < n, k++ ]; a[n] = k; Print[ a[n]], {n, 1, 14}]

%o (C) /* See links. */

%Y Cf. A084321.

%K nonn

%O 1,1

%A _Robert G. Wilson v_, Jun 26 2003

%E a(15)-a(20) from _Kevin Ryde_, Mar 09 2024