An #Exact #Formula for the #Primes: #Willans' Formula - YouTube
I didn't know this formula existed. It was published in 1964 but if you look at it carefully, it's not a formula as such, it's actually an #algorithm coded into some nifty #maths. It gets excruciatingly slow for even modest values on n, when n represents the nth prime. I've written it as a #maxima code below.
https://www.youtube.com/watch?v=j5s0h42GfvM
#WillansFormula #Mathematics #PrimeNumbers
prime(n):=1+sum(floor((n/sum(floor(cos(%pi*(factorial(j-1)+1)/j)^2),j,1,i))^(1/n)),i,1,2^n);