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
131
17
9 years ago 00:03:04 22
“It’s not an exact science...“ | Dez & Ally (HUMOUR 2.0)
2 years ago 00:14:47 14
An Exact Formula for the Primes: Willans’ Formula
2 years ago 00:00:54 11
xDrill™ vs. Conventional Drill — DepthSense™ Allows You to Drill at an Exact Depth With Ease
4 years ago 00:00:59 0
Artist Painted Woman Of His Dreams, Then Married An Exact Lookalike
6 years ago 00:12:24 0
Who Exactly is an “Asian?”
1 year ago 00:03:34 0
How to make an exact flat metal surface by using scraper.
4 years ago 00:09:27 0
Can I Make Cadbury Creme Eggs VEGAN?! This might taste like an exact dupe...
5 years ago 00:01:05 0
Scientists Capture ‘Exact Moment’ an Old Star Starts to Change Form
6 years ago 00:04:49 8
[NeurIPS 2019] On Exact Computation with an Infinitely Wide Neural Net
8 years ago 00:03:25 43
What is an API?
6 years ago 00:12:14 0
Who Exactly is an “African?”
1 year ago 00:13:27 0
I Made A Kunai From The Game Mortal Kombat! An Exact Replica Of The Scorpion Weapon
9 years ago 00:14:23 42
A, AN, THE - Articles in English
10 years ago 00:05:15 163
Stuck in an Elevator
10 years ago 00:17:48 1.2K
TWO COFFEES AND AN ORGASM
11 years ago 00:01:31 88
Daria Kondakova | Ribbon 2010 (Exact Cut)
4 years ago 01:00:01 11
Detective Jake Peralta screams while strumming an acoustic guitar for 1 exact hour
7 years ago 00:02:14 22
PARALLAX: An RX0 Production
3 years ago 00:07:54 3
What exactly is an algorithm? Algorithms explained | BBC Ideas
7 years ago 00:12:35 98
An Inside Look At Our Insane Process For Hiring Spanish Teachers