Formulas for the nth prime number actually exist! One was cleverly engineered in 1964 by C. P. Willans. But is it useful?
----------------
References:
Herbert Wilf, What is an answer?, The American Mathematical Monthly 89 (1982) 289-292.
C. P. Willans, On formulae for the nth prime number, The Mathematical Gazette 48 (1964) 413-415.
Further reading:
Jeffrey Shallit, No formula for the prime numbers?.
----------------
# Python code
import math
def prime(n):
return 1 sum([
(pow(n/sum([
(pow(( * ((j - 1) 1)/j), 2))
for j in range(1, i 1)
]), 1/n))
for i in range(1, pow(2, n) 1)
])
----------------
(* Mathematica code *)
prime[n_] := 1 Sum[Floor[(n/Sum[Floor[Cos[Pi ((j - 1)! 1)/j]^2], {j, 1, i}])^(1/n)], {i, 1, 2^n}]
----------------
0:00 A formula for primes?
1:24 Engineering a prime detector
4:00 Improving the prime detector
5:46 Counting primes
6:29 Determining the nth prime
9:42 The final step
11:36 What counts as a formula?
12:56 What’s the point?
13:51 Who was Willans?
----------------
Animated with Manim.
Thanks to Ken Emmer for supplying the microphone.
Web site:
Twitter:
14 views
160
21
2 weeks ago 00:01:20 22
Fireworks of Berlin
2 weeks ago 00:35:42 1
Journey to the Center of the Earth (It Took 8 Days, I Lost 10kg)
2 weeks ago 02:39:28 5
Old English Pronunciation: A Comprehensive Reconstruction
2 weeks ago 00:03:57 5
Bittu Mallick - Jay Shree Krishna | +12
3 weeks ago 00:19:31 1
Winter Survival Shelter - Sleeping Outside in -25° Weather
3 weeks ago 00:07:15 1
Ana Vidovic plays Asturias by Isaac Albéniz on a Jim Redgate classical guitar
4 weeks ago 01:01:06 2
I Was Raised In A Satanic Cult | Surviving Hell with Kibbi Linga
4 weeks ago 01:03:33 1
I was sex trafficked by GirlsDoPorn Pt.1 || Consider Before Consuming Podcast
1 month ago 00:08:59 1
Telegram Signal Copier : Trade Smarter, Not Harder!
1 month ago 00:04:42 1
Copy Trading : Telegram Signal Copier to Skyrocket Profits!
1 month ago 00:54:33 1
(FULL) Beethoven Symphony No.6 “Pastorale“ And Egmont Overture - London Philarmonic Orchestra
1 month ago 01:00:57 1
Complément d’enquête. Catherine Deneuve : la demoiselle insoumise - 30 août 2018 (France 2)