Is this formula for the $n^{th}$ prime number useful?

Is the below formula for the $n^{th}$ prime number in elementary functions useful somehow?

$$p(n)=\sum _{a=2}^{2^n} \sin \left(\pi 2^{\left(n-\sum _{b=2}^a \frac{\sin ^2\left(\frac{\pi }{b}((b-1)!)^2\right)}{\sin ^2\left(\frac{\pi }{b}\right)}\right)^2-1}\right)\frac{a \sin ^2\left(\frac{\pi }{a} ((a-1)!)^2\right) }{\sin ^2\left(\frac{\pi }{a}\right)}.$$


Solution 1:

Every "elementary" formula I know of is a disguised implementation of a slow algorithm for testing whether a number is prime. For actually computing primes, it's better just to directly implement a fast primality testing algorithm, of which there are many. For actually proving something about primes, experience has shown that it's better to either ask for asymptotic rather than exact information or to use more sophisticated techniques (e.g. the Riemann zeta function).

A basic reason formulas like the one you give are not useful for proving anything is that they involve the cancellation of many terms, and there's no way to extract reliable asymptotic information without knowing much more about how the terms cancel.

Solution 2:

C P Willans, On formulae for the $n$th prime, Math Gazette 48 (1964) 413-415 gives $$\pi(m)=\sum_2^m(\sin^2\pi{((j-1)!)^2\over j})/\sin^2(\pi/j))$$ This is quoted in Paulo Ribenboim, The Little Book of Bigger Primes.