cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

1, 3, 5, 10, 19, 35, 64, 139, 256, 536, 1061, 2095, 4169, 8282, 16517, 32903, 65646, 131205, 262579, 525083, 1048893, 2098826, 4195521, 8390583, 16782032, 33560609, 67118347, 134229613, 268453180, 536890474, 1073764782, 2147523518
Offset: 1

Views

Author

Labos Elemer, Jun 19 2003

Keywords

Comments

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

Examples

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

Crossrefs

Programs

  • C
    /* See links */
  • Mathematica
    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}]

Formula

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

Extensions

Edited and extended by Robert G. Wilson v, Jun 24 2003
Definition clarified by Jianing Song, Aug 08 2022
a(26) corrected by Kevin Ryde, Apr 25 2024