![]() |
![]() |
#1 |
May 2016
2·34 Posts |
![]()
Good morning ,
I tried this formula and it seems that if the number that returns the result is an integer it happens that p is a prime number, vice versa if it is a float number p = is not a prime number. good day to you. Last fiddled with by Godzilla on 2019-03-12 at 08:29 |
![]() |
![]() |
![]() |
#2 |
"Robert Gerbicz"
Oct 2005
Hungary
5A216 Posts |
![]()
Try p=341 (Frédéric Sarrus, 1819!).
|
![]() |
![]() |
![]() |
#3 | |
Sep 2002
Database er0rr
358910 Posts |
![]() Quote:
Code:
? ((2^341-2)/341)^2 172563239398117273000218395474248723524247825368023692410729784705364145650902467350956998726199306256798037938929706033772341405068055342449427015484989122022407614607963613122004059079503254688702500 ![]() See: https://en.wikipedia.org/wiki/Fermat_pseudoprime |
|
![]() |
![]() |
![]() |
#4 |
Einyen
Dec 2003
Denmark
1011110101112 Posts |
![]()
http://mathworld.wolfram.com/FermatsLittleTheorem.html
Only for primes and pseudoprimes is p a factor of 2^p-2 which makes (2^p-2)/p an integer. |
![]() |
![]() |
![]() |
#5 |
May 2016
2·34 Posts |
![]()
Thanks to all of you, now I remember trying a similar formula but giving mod 2, I hadn't noticed the similarity.
|
![]() |
![]() |
![]() |
#6 |
Jun 2003
12F816 Posts |
![]()
The squaring is useless. It can't turn a fraction into an integer. So, you only need to check if 2^p==2 (mod p). Which is Fermat's little theorem with base = 2
|
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can you make mew understand the LLR Test? | a1call | Miscellaneous Math | 9 | 2016-09-20 23:04 |
I don't understand these relation counts | fivemack | Msieve | 4 | 2012-10-29 11:26 |
Finally I understand EVERYTHING! | Flatlander | Lounge | 2 | 2010-10-10 14:30 |
Don't understand instructions for upgrading to v25 | John S | Software | 22 | 2008-11-10 21:20 |
I just don't understand this | kuratkull | Sierpinski/Riesel Base 5 | 2 | 2007-03-12 21:02 |