mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Miscellaneous Math

Reply
 
Thread Tools
Old 2019-03-12, 08:28   #1
Godzilla
 
Godzilla's Avatar
 
May 2016

7×23 Posts
Default 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
Godzilla is offline   Reply With Quote
Old 2019-03-12, 08:48   #2
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

58116 Posts
Default

Try p=341 (Frédéric Sarrus, 1819!).
R. Gerbicz is offline   Reply With Quote
Old 2019-03-12, 08:51   #3
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

22×859 Posts
Default

Quote:
Originally Posted by Godzilla View Post
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
paulunderwood is online now   Reply With Quote
Old 2019-03-12, 09:01   #4
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

5×593 Posts
Default

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.
ATH is offline   Reply With Quote
Old 2019-03-12, 09:08   #5
Godzilla
 
Godzilla's Avatar
 
May 2016

7·23 Posts
Default

Thanks to all of you, now I remember trying a similar formula but giving mod 2, I hadn't noticed the similarity.
Godzilla is offline   Reply With Quote
Old 2019-03-12, 09:34   #6
axn
 
axn's Avatar
 
Jun 2003

126216 Posts
Default

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
axn is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
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

All times are UTC. The time now is 21:58.

Mon Oct 19 21:58:54 UTC 2020 up 39 days, 19:09, 0 users, load averages: 1.94, 1.62, 1.66

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.