Hacker News new | past | comments | ask | show | jobs | submit login

I have a result which shows that a squared number minus 2, if put through the fermat test (modular exponentiation), is always prime. I got some 30k digit primes this way, but I couldn't get mathematicians interested in it. They'd just ignore it and say it was obvious.

Is anyone interested in me writing a little document and posting it to Hacker News?




Do you mean (1) n^2-2 always passes the Fermat test (to what base(s)?) or (2) if n^2-2 passes the Fermat test (to what base(s)?) then it is actually prime?


Yes, that's exactly what I'm saying. I'll post about this to HN soon.


Um, I was asking which; #1 and #2 are very different. For instance: A result of the form "n^2-2 is always a Fermat pseudoprime to base SOME-FUNCTION-OF-N" would probably not be interesting. A result of the form "n^2-2 is always a prime provided it's a Fermat pseudoprime to base SOME-FUNCTION-OF-N" would be much more so.

(Where "interesting" means "interesting to me"; no one else need share my interests.)


I just know I've never found a prime with this method, that PFGW didn't say was a prime.

n^2-2 doesn't always pass the Fermat test, but if it does, it is always a prime. I think it's base 2.

Is that an okay answer? I'll clarify in this thread if you need.

(Posted Lisp code to: http://www.decompiler.org/r2primes.htm)


On that page, you conjecture that no Carmichael number has 2 as a quadratic residue. This conjecture is incorrect; 304^2 is congruent to 2 mod 6601, and 6601 is a Carmichael number.

Even if it were true that no Carmichael number has 2 as a quadratic residue, that wouldn't give an efficient way of finding very large prime numbers, because to prove something prime given that it isn't Carmichael you still have to run the Fermat test to every base, which will take ages.

Now, that isn't the same as saying that n^2-2 is never a Carmichael number. I've no idea whether that's true, but it wouldn't be very surprising; hand-wavily, the "probability" that m is a square is on the order of 1/m, and the "probability" that m is a Carmichael number is something complicated-ish that's less than 1/(log m)^2, and so the probability that m is both is less than 1/m(log m)^2, whose integral is finite, so there should only be finitely many Carmichael numbers of the form n^2-2, and if there aren't any small ones then probably there aren't any at all. But, again, even if it's true that n^2-2 is never a Carmichael number, that doesn't give you an efficient way of generating primes.

It's also not the same thing as saying that n^2-2 never passes the Fermat test to base 2 without being prime. That also might be true, for the same hand-wavy reason as above (the number of Fermat pseudoprimes to a given base satisfies an upper bound of the same general form as the number of Carmichael numbers). Most likely it's either very easy or very difficult to prove, if it happens to be true.

In any case, for practical purposes, if you generate a very large number at random and it passes the Fermat test to any one base, then it's almost certainly prime. (For your numbers with thousands of digits, if a single Fermat test says the number is prime then it's more likely to be wrong because your computer has malfunctioned than because you happened to pick a non-prime that satisfies the Fermat test.)


Thanks so much for taking the trouble to tell me why it's impractical, hard to prove and not interesting. I'll probably remove the webpage. I'll move onto my other (software) projects.


You're going to have trouble getting mathematicians interested in just a hunch. Earlier, you used the phrase: "I have a result which shows..." Which, in maths parlance, that would imply you have a proof. Which, if correct, would be rather interesting.

Though, without a proof, it's uninteresting. It's probably not true.


removed.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: