An Exact Formula for the Primes: Willans' Formula

preview_player
Показать описание
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([
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?

----------------

Thanks to Ken Emmer for supplying the microphone.

Рекомендации по теме
Комментарии
Автор

Assuming Birmingham is the British one, rather than the one in Alabama, then our C.P. WIllans should be in the England and Wales Birth, Marriage and Death records so I had a look for you.

I found a Charles Percy Willans whose birth was registered in Huddersfield in 1878, and whose marriage to either Amy Warner or Beatrice Woodman was registered in Birmingham(!) in 1899. Then there's another Charles Percy Willans whose birth is registered in Birmingham(!!) in 1902, with mother's maiden name Warner, making him likely the son of the other one, and making it likely the other one's wife was Amy Warner rather than Beatrice Woodman. A Charles Percy Willans (presumably the younger one) registered a marriage in 1923 in Sculcoates to Ada Smith. The problem is the younger Charles Percy's death was registered in Buckrose aged 55 in 1957, and the older one's death was registered in Hull aged 81 in 1960, so if it was either of these gentlemen they'd have to have been published at least a few years posthumously, and I've no idea if that is plausible.

There is only one other possibility, a Christopher Paul Willans whose birth is registered in 1942 Bradford, with mother's maiden name Walker. Sadly there is a death registered in 1971 in Bradford of a Christopher Paul Willans who was born 17th January 1942. Looking for a marriage of a Mr Willans and Miss Walker gives me Christopher's likely parents, Ernest Victor Willans and Jessie G Walker, who married in 1937, and looking for Ernest's details shows that he was born in 1904, and died in 1964 aged 59. Looking for Jessie G Willans led me to a death record in 1984 in Bradford of Jessie Gordon Willans who was born 5th March 1909, so that is likely her. Checking for births of Willans' with mother's maiden name Walker didn't find any real possibilties for siblings, so Christopher was likely an only child. Also no sign of a marriage for him, so probably no children either. All in all I suspect C.P.Willans actually was Christopher Paul, but can't find actual proof, and he seems to have no living close relatives who could be contacted and asked if he was the mathematician in question.

One other possibility to bear in mind is that C.P. might have been a woman who had either married a Mr Willans, or who was born as a Miss C.P. Willans and went on to marry and change her surname afterwards. If C.P. was a woman perhaps she used initials-only to conceal this fact, rather like J.K.Rowling did. I found only one female whose birth name was of the form 'C.P. Willans' but she was born in the early 60s (and is very likely still living, so I have to stay vague here for data protection reasons) so she can be ruled out. Searching for every Miss C.P [Surname] who ever (by 1964 anyway) married a Mr Willans is a harder and more time consuming task which I'm afraid I don't have the opportunity to attempt today.

MrDannyDetail
Автор

I’m pretty sure C. P. Stands for coolformulaforcalculating primes

jakebrusca
Автор

The floor function is the key here. It's basically a conditional.

gblargg
Автор

When I first saw the formula I was like.... ya, I'll never get that. Then I followed the formula every step of the way with no difficulties after you explained it. You are amazing at explaining things, man. That's a rare gift.

tolstoj_
Автор

My favorite example of this sort of “math as a programming language” is the guy who managed to extend the 3n+1 problem into a continuous function that can be expanded to process complex numbers.

It goes like this:

C(z)=.25(2 +7z -(2+5z)cos(πz))

It’s beautifully simple _(when not expanded)_ and super cool.

iamsushi
Автор

I have devised a formula for working out the true identity of C. P. Willans. It involves representing a human being as a positive integer that encodes the information in all of their synaptic connections. Part of the formula then loops through the interactions between the synapses, generating all the thoughts that this person would have, including all the mathematical papers that they would compose. You then have to apply a function that yields 1 if these mathematical papers include the paper with the prime-generating formula in it, and 0 otherwise. Then of course you have to loop through all possible humans, picking out those for whom the formula yields a 1. It all gets very messy, but I have completed the work. I would quote the formula explicitly in this comment, but unfortunately the character limit does not permit it.

omp
Автор

As an engineer who frequently uses a fair amount of math, I am impressed with how elegantly all the pieces fit together, even if it is slow to implement. I'll have to keep this in mind the next time I have a complicated function / algorithm to design. It's something to aspire to!

Cynthia_Cantrell
Автор

This was one of the most incredible explanations I've ever heard. You broke down an unapproachable formula into small digestible bits, and it seemed so easy afterwards!

Thank you, and your teaching skills are fabulous!

uhbayhue
Автор

Primes aside: I find the idea of turning source code into a math formula, which can be processed with a whole new set of tools, very fascinating. Yes, it is massively chunky and the complexity (think big O) is through the roof, still you can write it down without problems. Maybe there is a similar approach for other algorithms, which then can yield new insights. A very interesting field of study. I have to learn more about this.

AndreasHontzia
Автор

He didn't find a suitable programming language so he decided to use math as one.

zhru-kqin
Автор

Please keep going; don’t stop! Your pacing, narration, and tone are exceptional. I’m so happy to have another maths channel to follow. Great work!

yumnuska
Автор

This is just amazing. I never in my life conceived that you could write something that I’d feel must require an algorithm as a formula. It’s superbly ingenious and mind blowing. Thanks for making this

oystercatcher
Автор

I feel like the existence of such a formula wouldn't be too surprising in the 1960s since it's after Turing's paper and the study of primitive recursion, but I did study recursion/computability theory. Though the specific formula itself is pretty cool.

sugarfrosted
Автор

This is super cool! I haven't had the chance to study formulas like this yet, but it's amazing seeing what ones mind can come up with!
P.S. The way you formulated this video is amazing, it was well paced and very digestible, I could follow along despite my lack of knowledge so hats off to you! I hope you keep creating content, I love what you're doing!

nicholasouellette
Автор

Excellent video, Eric! Something about this made me nostalgic for high school: I recall vividly the point when I started seeing formulas as shorthand for computational algorithms, when I reproduced the formula for Riemann sums by recalling the process of chopping the area under the curve into rectangular bits. Numerous other formulas for integrals in calculus came immediately; I rarely had to memorize them because the correspondence between the formula and the geometry is so crystal clear.

spase
Автор

This video is an absolute beauty. It should be shown to each and every math student in the world. Kudos!

AlessandroBottoni
Автор

Love it! Your way of narration is excellent, the pacing really on point. Keep it up. ✨

Spulg
Автор

I feel like the floor function is some kind of "cheat" for algebraic operations. It's basically using an if statement

IngresaElNombreDelCanal
Автор

Fantastic video! Probably one of the best I have seen in terms of presentation and clarity. Step by step you took me from "this formula is impossible to understand" to "this makes perfect sense". Definitely keep up the great work!

mathiasriedel
Автор

I hope more mathematicians pick something rather complicated looking and break it down like you did. It is so enlightening thank you so much.

krumpy