
What do 5, 13 and 563 have in common?
video description
If we wrote the code like:
SET f TO 1
SET n TO 1
WHILE TRUE
f EQUAL f MULTIPLY n
SET result TO ( f + 1 ) / ( n + 1 )
IF result IS -whole number-
OUTPUT -Prime-
ELSE
OUTPUT -Composite-
n EQUAL n PLUS 1
END WHILE
Determining whether or not a number is a whole number is fairly trivial, one way is to floor the result and see if both numbers are still the same. 5 floored equals 5, but 8. 7 floored equals 8. 5 == 5 but 8. 7! = 8
We could, in theory, run this and get a list of every Prime Number possible if we assume time is not a factor.
Since n! is equal to (n-1! - n each iteration only needs to increase the factorial by 1 calculation. If we're smart with memory management we could store the large factorial and the number it's a factorial of in a separate place so that we can start and stop this with varying values of f and n depending on this table.
Obviously we could make this check much more sophisticated and less exhaustive, but I still thought it was interesting enough to share. The largest, obvious, problem is memory management and data overflow, but these are solvable problems.
Date: 2022-04-08
Related videos
Comments and reviews: 9
oen
So I created this python program that checks for wilson primes. Two, actually. The first one just checks the number you enter and does exactly what it's supposed to do. It tells if the number you typed is composite, prime or a wilson prime. It obviously works with 5, 13, and 563. Altho I got quite frustrated on finding another wilson prime and made a second program. This time, it _finds_ composites, primes or wilson primes in a range (like 1-200. Which would make it faster! But I ran into a problem. No matter how far I type it, even at 100000 or any huger number, it only gives me those three numbers and can't find anything else. I'm not sure whether this is definitive proof whether there _are_ only finitely many Wilson primes. But I'm certain that's not enough evidence.
reply
So I created this python program that checks for wilson primes. Two, actually. The first one just checks the number you enter and does exactly what it's supposed to do. It tells if the number you typed is composite, prime or a wilson prime. It obviously works with 5, 13, and 563. Altho I got quite frustrated on finding another wilson prime and made a second program. This time, it _finds_ composites, primes or wilson primes in a range (like 1-200. Which would make it faster! But I ran into a problem. No matter how far I type it, even at 100000 or any huger number, it only gives me those three numbers and can't find anything else. I'm not sure whether this is definitive proof whether there _are_ only finitely many Wilson primes. But I'm certain that's not enough evidence.
reply
Felix
they're all numbers, they all exist, they're all odd, they're all prime, they're all answers to certain addition sums, they're all answers to certain subtraction sums, they're all somewhat related to mathematics, they all have digits, they all have at least one digit which is a 5 or 3, if you add up all they're digits you get a number either lower or the same as the original, they all don't contain any of the following digits: 0, 2, 4, 7, 8, 9, they're all below 1000.
reply
they're all numbers, they all exist, they're all odd, they're all prime, they're all answers to certain addition sums, they're all answers to certain subtraction sums, they're all somewhat related to mathematics, they all have digits, they all have at least one digit which is a 5 or 3, if you add up all they're digits you get a number either lower or the same as the original, they all don't contain any of the following digits: 0, 2, 4, 7, 8, 9, they're all below 1000.
reply
Jacek
well. that's instersting- but what's benefit of that? is there any practical value out of that? Why it is not n! -3 or n! +5? because As a mathematical noob I can say, there's whole bunch of function like that (actually infinite number) and some of them will probably work for some numbers. Why is this one in particular important, worth the name of a guy who invented it, and the whole Numberophlie episode?
reply
well. that's instersting- but what's benefit of that? is there any practical value out of that? Why it is not n! -3 or n! +5? because As a mathematical noob I can say, there's whole bunch of function like that (actually infinite number) and some of them will probably work for some numbers. Why is this one in particular important, worth the name of a guy who invented it, and the whole Numberophlie episode?
reply
Хекфи
Let's make video about permutable primes - numbers which are prime at any order of digits. There are four pairs of 2-digited primes (13, 31, (37, 73, (17, 71) and (79, 97) and three triplets of 3-digited primes (113, 131, 311, (337, 373, 733) and (199, 919, 991.
And primes with only one different digit - 2, 3, 5, 7, 11, 1111111111111111111, 11111111111111111111111.
reply
Let's make video about permutable primes - numbers which are prime at any order of digits. There are four pairs of 2-digited primes (13, 31, (37, 73, (17, 71) and (79, 97) and three triplets of 3-digited primes (113, 131, 311, (337, 373, 733) and (199, 919, 991.
And primes with only one different digit - 2, 3, 5, 7, 11, 1111111111111111111, 11111111111111111111111.
reply
JayTemple
I'm a huge, longtime fan of the Pyramid game show. Sometimes I think of end-game categories for target audiences. (For example, the ordinary show would have FAMOUS BASEBALL PLAYERS, but a show with sports fans would include SHORTSTOPS) I could have a mid-level category of TYPES OF PRIME NUMBERS.
reply
I'm a huge, longtime fan of the Pyramid game show. Sometimes I think of end-game categories for target audiences. (For example, the ordinary show would have FAMOUS BASEBALL PLAYERS, but a show with sports fans would include SHORTSTOPS) I could have a mid-level category of TYPES OF PRIME NUMBERS.
reply
-=Spaokobb=-
Before Watching, I Thought The Following:
Write The Numbers Backwards.
You Get 365, 31, and 5.
365 Days in A Non-Leap Year.
Maximum of 31 Days in A Month.
5 Days In a Week Excluding Weekends.
I Guess That Was Just Some kind of Coincidence?
reply
Before Watching, I Thought The Following:
Write The Numbers Backwards.
You Get 365, 31, and 5.
365 Days in A Non-Leap Year.
Maximum of 31 Days in A Month.
5 Days In a Week Excluding Weekends.
I Guess That Was Just Some kind of Coincidence?
reply
Хекфи
Dear Numberphile,
Why not to make video about palindromic prime pairs with no primes between them?
Only three such pairs are known: 181/191, 787/797 and 919/929. Availability of the other such pairs is great question.
reply
Dear Numberphile,
Why not to make video about palindromic prime pairs with no primes between them?
Only three such pairs are known: 181/191, 787/797 and 919/929. Availability of the other such pairs is great question.
reply
Christian
according to Wilson's Theorem, 1 is a prime? and also a Wilson Prime?
explain what i calculated wrong because i did (1-1! + 1 and it said 2 but 0! = 0 and 0+1 = 1 and 1/1 = 1 and 1 is divisible by 1
reply
according to Wilson's Theorem, 1 is a prime? and also a Wilson Prime?
explain what i calculated wrong because i did (1-1! + 1 and it said 2 but 0! = 0 and 0+1 = 1 and 1/1 = 1 and 1 is divisible by 1
reply
Fuartianer
I am currently thinking that math is describing the whole universe. And there is always the -equal- -=- sign. so does math stand and fall with this sign. Must there always an -gleichniss-.
reply
I am currently thinking that math is describing the whole universe. And there is always the -equal- -=- sign. so does math stand and fall with this sign. Must there always an -gleichniss-.
reply
Add a review, comment
Other channel videos















