login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Least number k such that between k! and (k+1)! there are n powers of 2 (each interval includes (k+1)! but not k!).
4

%I #22 Apr 25 2024 10:22:07

%S 1,3,5,10,19,35,64,139,256,536,1061,2095,4169,8282,16517,32903,65646,

%T 131205,262579,525083,1048893,2098826,4195521,8390583,16782032,

%U 33560609,67118347,134229613,268453180,536890474,1073764782,2147523518

%N Least number k such that between k! and (k+1)! there are n powers of 2 (each interval includes (k+1)! but not k!).

%C a(n) is near the (n-1)th power of 2, the difference is A085355.

%H Kevin Ryde, <a href="/A084321/b084321.txt">Table of n, a(n) for n = 1..750</a>

%H Kevin Ryde, <a href="/A084321/a084321.c.txt">C Code</a>

%F a(n) = minimum x for which floor(log_2((x+1)!)) - floor(log_2(x!)) = n.

%F a(n) = minimum x for which A084320(x) = n.

%e a(3)=5 since between 5!=120 and 6!=720 is the first time 3 powers of 2 arise, namely, 128, 256 and 512.

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

%o (C) /* See links */

%Y Cf. A067850, A058033, A000142, A000079, A084320, A084420, A085355.

%K nonn

%O 1,2

%A _Labos Elemer_, Jun 19 2003

%E Edited and extended by _Robert G. Wilson v_, Jun 24 2003

%E Definition clarified by _Jianing Song_, Aug 08 2022

%E a(26) corrected by _Kevin Ryde_, Apr 25 2024