Readit News logoReadit News
jmount · 3 months ago
The original Agrawal, Kayal, Saxena "Primes is in P" paper is actually an amazing effort in clarity https://annals.math.princeton.edu/wp-content/uploads/annals-... .
oliviersca · 3 months ago
For those who enjoy burning cpu cycles ! m1277 = 2 ^ 1277 - 1 is not prime. It easy to check it with the Lucas-Lehmer test. But we don't know any of its divisors, which is quite fascinating.
roflchoppa · 3 months ago
The Lehmers are cool people… Ron’s got a train spotting site.

http://calcoastrails.com/

jrockway · 3 months ago
I knew about this site and knew about the Lucas-Lehmer test, but I never would have made the connection between the two. People are kind of amazing.
roflchoppa · 3 months ago
I knew Derrick Lehmer Jr before he passed away, just happened to know the name.
30030 · 3 months ago
That's easy.

(factorial(170,141,183,460,469,231,731,687,303,715,884,105,726) + 1)%(170,141,183,460,469,231,731,687,303,715,884,105,727) == 0

IsTom · 3 months ago
My favourite prime checking algorithm is that for n < 100 if it looks prime, it is prime.
freehorse · 3 months ago
Up to 100 it is relatively simple, if you remove the even numbers, the multiples of 3 (summing up their digits recursively gives 3 6 or 9), and those that end at 5, you end up with 25 numbers out of which 22 (88%) are primes. If you further exclude 49 which you should remember is 7^2 from the multiplication table, and 77 that is obviously divisible by 7, you are left with 22/23 chance a number that passes these exclusion criteria is not 91 and hence it is a prime.
maxbond · 3 months ago
> (summing up their digits recursively gives 3 6 or 9)

My fun fact is that this type of operation (repeatedly applying a child operation until you reach a fixed point) is called persistence.

https://en.wikipedia.org/wiki/Persistence_of_a_number

The fixed point here being that if you add up a list of 1 digits, you'll always reach the same number (`sum([1]) = 1`). The best known is probably the hailstone sequence.

https://en.wikipedia.org/wiki/Collatz_conjecture

I'm partial to multiplicative persistence.

https://www.youtube.com/watch?v=Wim9WJeDTHQ [15m]

jeffbee · 3 months ago
> summing up their digits recursively gives 3 6 or 9

What does this part mean? For example 57.

throwaway81523 · 3 months ago
Like the famous Grothendieck prime of course.
xorbax · 3 months ago
Definitely makes me feel better about my own work
floydian10 · 3 months ago
91 should be prime, ridiculous that it isn't
sunrunner · 3 months ago
Agree. Plus now I now need to release a security patch for the hand-rolled crypto library I built.
emaccumber · 3 months ago
The annoying child in me will always remember correcting my freshman math teacher when he needed a prime number and wrote 91 on the chalkboard.
sunrunner · 3 months ago
I wonder what the underlying human intuition is for 'prime-ness' and why it might break down with larger numbers. Odd numbers in the rightmost position? The 'shape' of the number (phonaesthesia, the bouba/kiki effect)? Maybe they just sort of feel scary?
IsTom · 3 months ago
For n < 100 to be composite you need a factor < sqrt(100) = 10. Rules for 2, 3, 5 are easy to try quickly. That leaves 7, but up to 7*9 you should remember it from multiplication tables. 77 is quite obviously divisible by 11 too, and then it's 7*13 = 91 as the last boss. But I feel that once you realize how special 91 is in that context, you won't forget it again.
conradev · 3 months ago
This only works if you know multiplication tables which is not a given in America these days.
gosub100 · 3 months ago
"not given" != "not able to learn"
GMoromisato · 3 months ago
Are there any numbers that don't look prime but are, in fact, prime? [Other than 2, I suppose.]
andruby · 3 months ago
11, 13, 17 and 19 used to trip me up. And maybe 67
ridiculous_fish · 3 months ago
Except 91.

Deleted Comment

Deleted Comment

chrisshroba · 3 months ago
Except 91
wbl · 3 months ago
57

Dead Comment

Nevermark · 3 months ago
Just grab some paper, a pen, and check that no number equal or smaller than its square root divides into it evenly.

That is it. That is all. Pish posh.

WCSTombs · 3 months ago
The example given in the article is 2^127 - 1, which was historically proved to be prime without computers using a clever method now known as the Lucas-Lehmer test. Your algorithm is not practical for that number.
Nevermark · 3 months ago
Ah, but I can assure you, it is just that simple.

If a number is not prime, then it is the product of at least two numbers smaller than itself.

If any of them are larger than its square root, all others must be smaller, or their product would be larger than the candidate prime.

Ergo, just check that the candidate is not evenly divisible by any number equal or lower than its square root.

This reasoning holds, independent of scale.

QED. Check mate. Shazam.

great_wubwub · 3 months ago
/r/whoosh
tmtvl · 3 months ago
Even better: you only have to check primes smaller than or equal to the square root.
NetMageSCW · 3 months ago
Pay wall.
WolfeReader · 3 months ago
Imagine browsing the web without an ad blocker.