Willans' formula is a prime-generating formula due to Willans (1964) that is defined as follows. Let
for a positive integer
, where
is the floor function.
This formula is a consequence of Wilson's theorem
and conceals the prime numbers
as those for which
, i.e., the values of
are 1, 1, 1, 0, 1, 0, 1, 0, 0, 0,
1, ... (OEIS A080339). Then, for a positive
integer
,
 |
(3)
|
For a positive integer
, the
th prime number
is
where
is the prime counting function (Willans
1964; Havil 2003, pp. 168-169).
See also
Prime Formulas,
Prime
Number,
Wilson's Theorem
Explore with Wolfram|Alpha
References
Havil, J. Gamma: Exploring Euler's Constant. Princeton, NJ: Princeton University Press, 2003.Rowland,
E. "An Exact Formula for the Primes: Willans' Formula." Sept. 22,
2022. https://www.youtube.com/watch?v=j5s0h42GfvM.Sloane,
N. J. A. Sequence A080339 in "The
On-Line Encyclopedia of Integer Sequences."Willans, C. P.
"On Formulae for the
th Prime Number." Math. Gaz. 48, 413-415,
1964. https://doi.org/10.2307/3611701.Referenced
on Wolfram|Alpha
Willans' Formula
Cite this as:
Weisstein, Eric W. "Willans' Formula."
From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/WillansFormula.html
Subject classifications