![]() |
![]() |
#1 |
Feb 2021
Salt Lake City, UT
29 Posts |
![]()
I independently confirmed two Mersenne non-primes below 1GHz x 1 min https://www.mersenne.ca/exponent/172279571 and https://www.mersenne.ca/exponent/172279589
with the following Mathematica code: Do[a = RandomInteger[100000]; b = PrimeQ[a*2*172279571 + 1]; If[b == True, Print[b, " ", a, " ", IntegerQ[(2^(172279571) - 1)/(a*2*172279571 + 1)]]], {i, 1, 10000}]; |
![]() |
![]() |
![]() |
#2 | |
Sep 2002
Database er0rr
E2216 Posts |
![]() Quote:
Code:
p=17227971;for(a=1,100000,if(Mod(2,2*a*p+1)^p==1,print([p,a]))) Last fiddled with by paulunderwood on 2021-02-09 at 13:40 |
|
![]() |
![]() |
![]() |
#3 | |
Feb 2021
Salt Lake City, UT
29 Posts |
![]() Quote:
? p=172279571 %9 = 172279571 ? for(a=1,100000000,if(Mod(2,2*a*p+1)^p==1,print([p,a]))) [172279571, 25] [172279571, 1138120] I mean I did not know and did not check in the databases if they were primes and found them independently simply guessing them primes and then finding that those factors are small recovering the old result by random toss of a in a narrow belt: Last fiddled with by mattprim on 2021-02-09 at 16:18 |
|
![]() |
![]() |
![]() |
#4 | |
Sep 2002
Database er0rr
2×33×67 Posts |
![]() Quote:
The heavy lifting is done with Mod(2,2*a*p+1)^p==1. There is no need for lots of memory to hold the full Mp number. I am not sure testing the primaiity of a potential factor is quicker. Perhaps you could translate my Pari/GP code into Mathematica code as an exercise and let us how fast it runs. Last fiddled with by paulunderwood on 2021-02-09 at 15:51 |
|
![]() |
![]() |
![]() |
#5 | |
Feb 2021
Salt Lake City, UT
1D16 Posts |
![]() Quote:
Last fiddled with by mattprim on 2021-02-09 at 16:16 |
|
![]() |
![]() |
![]() |
#6 |
Sep 2002
Database er0rr
E2216 Posts |
![]()
In order: TF (trial factoring), P-1 factoring and finally a lengthy PRP (probable prime) test is done (and an LL (Lucas Lehmer) test if successful).
|
![]() |
![]() |
![]() |
#7 |
Feb 2021
Salt Lake City, UT
29 Posts |
![]()
Giant 2^58501120901-1 is divisible by 13384*2*58501120901+1 = 1565958004277969 (about 1Ghz x hour to test it knowing it from PariGP on the same Ghz)
PrimeQ[58501120901] True IntegerQ[(2^(58501120901) - 1)/(13384*2*58501120901 + 1)] True Giant 2^13730539469-1 is divisible by 19*2*13730539469+1 = 521760499823 (1 Ghz x min Mathematica): Do[c = False; a = RandomInteger[100]; b = PrimeQ[a*2*13730539469 + 1]; If[b == True, c = IntegerQ[(2^(13730539469) - 1)/(a*2*13730539469 + 1)]]; If[b == True, Print[" ", a, " ", c]], {i, 1, 100}] 34 False 30 False 79 False 45 False 79 False 12 False 12 False 34 False 19 True 30 False 30 False |
![]() |
![]() |
![]() |
#8 | |
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
41·229 Posts |
![]() Quote:
You are trying to fix a wristwatch with a bread knife. Read the suggested literature first, then rethink your bread-knife strategy. |
|
![]() |
![]() |
![]() |
#9 | |
Romulan Interpreter
Jun 2011
Thailand
33×347 Posts |
![]() Quote:
Even mfakt[c|o], they won't test if the potential factors are prime, they just make a list of factors, sieve them for a while (which is much faster than x-PRP testing) and then do exponentiation (divisibility test) for the surviving candidates. This way, few percents of the surviving candidates are not prime, but it becomes faster to just do the exponentiation for them, than continue sieving (percent of composite factors depending on how large the sieving prime was). I think there was once a composite factor found this way, but I don't remember the exponent. Last fiddled with by LaurV on 2021-02-11 at 07:07 |
|
![]() |
![]() |
![]() |
#10 |
Sep 2002
Database er0rr
2·33·67 Posts |
![]() ![]() |
![]() |
![]() |
![]() |
#11 |
Feb 2021
Salt Lake City, UT
111012 Posts |
![]()
Mathematica has the native prime Number Theory routines: PrimeQ, NextPrime, PrimePi etc. Just was mainly curious how PrimeQ[2^n-1] giving the answer if 2^n-1 is prime. You can actually link stuff like PariGP to Mathematica using Mathlink so you can include own faster routines for Mersenne.
Last fiddled with by mattprim on 2021-02-11 at 11:16 |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Searching for m. primes is like playing lottery | joblack | Lounge | 20 | 2009-01-05 15:18 |
to be faster at searching mersenne primes | flosculus | Information & Answers | 6 | 2008-11-10 18:59 |
searching for Mersenne primes | davieddy | Math | 7 | 2007-08-21 04:51 |
A Proposal for searching Recurrence Series Primes | Erasmus | Factoring | 3 | 2004-05-14 09:26 |
Need help with math problem re: searching for all primes. | daxm | Miscellaneous Math | 5 | 2003-07-20 19:32 |