mersenneforum.org I don't understand this formula ..(((2^p)-2)/p)^2
 Register FAQ Search Today's Posts Mark Forums Read

 2019-03-12, 08:28 #1 Godzilla     May 2016 2·34 Posts I don't understand this formula ..(((2^p)-2)/p)^2 Good morning , $(\frac{2^{p}-2}{p})^{2}$ 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
 2019-03-12, 08:48 #2 R. Gerbicz     "Robert Gerbicz" Oct 2005 Hungary 2·733 Posts Try p=341 (Frédéric Sarrus, 1819!).
2019-03-12, 08:51   #3
paulunderwood

Sep 2002
Database er0rr

1110010110012 Posts

Quote:
 Originally Posted by Godzilla Good morning , $(\frac{2^{p}-2}{p})^{2}$ 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.
Code:
? ((2^341-2)/341)^2
172563239398117273000218395474248723524247825368023692410729784705364145650902467350956998726199306256798037938929706033772341405068055342449427015484989122022407614607963613122004059079503254688702500
Is 341 prime?

See: https://en.wikipedia.org/wiki/Fermat_pseudoprime

 2019-03-12, 09:01 #4 ATH Einyen     Dec 2003 Denmark 23×17×23 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.
 2019-03-12, 09:08 #5 Godzilla     May 2016 A216 Posts Thanks to all of you, now I remember trying a similar formula but giving mod 2, I hadn't noticed the similarity.
 2019-03-12, 09:34 #6 axn     Jun 2003 25×5×31 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

 Similar Threads Thread Thread Starter Forum Replies Last Post a1call Miscellaneous Math 9 2016-09-20 23:04 fivemack Msieve 4 2012-10-29 11:26 Flatlander Lounge 2 2010-10-10 14:30 John S Software 22 2008-11-10 21:20 kuratkull Sierpinski/Riesel Base 5 2 2007-03-12 21:02

All times are UTC. The time now is 05:13.

Mon May 10 05:13:36 UTC 2021 up 31 days, 23:54, 0 users, load averages: 3.35, 3.31, 3.02