![]() |
|
|
#1 |
|
Feb 2003
25 Posts |
I checked 31 of the 40 mersenne primes and found that 2*M^2-1 is prime only for 5 cases: M1 (n=2), M2 (n=3), M4 (n=7), M6 (n=17), and M7 (n=19).
2*(2^2-1)^2-1 is prime 2*(2^3-1)^2-1 is prime 2*(2^7-1)^2-1 is prime 2*(2^17-1)^2-1 is prime 2*(2^19-1)^2-1 is prime The others are mostly divisible by 17. Can it be proven that 2*M^2-1 is composite for the succeeding mersenne primes greater than M7? Just suppose 2*M40^2-1 [i.e., 2*(2^20996011-1)^2-1 ] is prime, as it is over 10 million digits, could it qualify for the $100,000? What software can test this? WinPFGW produced an error when I tried testing it. |
|
|
|
|
|
#2 | |
|
Sep 2003
5·11·47 Posts |
Quote:
|
|
|
|
|
|
|
#3 | |
|
"William"
May 2003
New Haven
2·7·132 Posts |
Quote:
|
|
|
|
|
|
|
#4 | |
|
Sep 2003
5·11·47 Posts |
Quote:
2*(2^20996011-1)^2-1 is more clearly written as 2*(220996011-1)2-1 |
|
|
|
|
|
|
#5 | |
|
Feb 2003
25 Posts |
Quote:
I got a Z_Err when I tried using it. |
|
|
|
|
|
|
#6 | |
|
∂2ω=0
Sep 2002
República de California
103×113 Posts |
Quote:
30*M40^2-1 has the small factor 5748019. (Nothing else < 10^9) 40*M40^2+1 has no factors < 10^9. |
|
|
|
|
|
|
#7 | ||
|
Feb 2003
25 Posts |
Quote:
Quote:
|
||
|
|
|
|
|
#8 | |
|
Sep 2003
A1916 Posts |
Quote:
|
|
|
|
|
|
|
#9 | ||
|
∂2ω=0
Sep 2002
República de California
103×113 Posts |
Quote:
Quote:
|
||
|
|
|
|
|
#10 | |
|
Banned
"Luigi"
Aug 2002
Team Italia
12CF16 Posts |
Quote:
I thought I could find some ideas about "modular binary exponentiation" in Crandall, or Mathworld... altough maybe there was an algorithm about it in Giantint library. Even Google gave me nothing. Any more links? Ah, one more question: in 40*M40^2+1 you have to add one instead of subtracting, no? Luigi |
|
|
|
|
|
|
#11 | ||
|
∂2ω=0
Sep 2002
República de California
103·113 Posts |
Quote:
Code:
if(n == 0)
return 1;
r = 1:
s = a;
while(n)
{
if(n & 1)
r = (r*s)%p;
s = (s*s)%p;
// right-shift the exponent:
n >>= 1;
}
return r;
The left-to-right variant of this (described in Knuth, I believe it's Vol. 2) similarly generates a sequence of modular squares, but it parses n from left to right, and requires no separate storage of a residue and a modsquare. Here, n is a signed int (this is necessary for the < 0 compare to work) and i is an integer index (signed or unsigned). You also need a user-supplied function leadz(), which returns the number of leading (leftmost) binary zeros in its argument: Code:
if(n == 0)
return 1;
//Number of bits to the right of leading ones bit.
leading_zeros = leadz(n);
nbits = 8*sizeof(n)-leading_zeros;
// Left-justify n and shift leftmost bit off.
n <<= (leading_zeros + 1);
r = a;
// Assumes the loop will not get executed if nbits < 1:
for(i = 1; i < nbits; i++)
{
r = (r*r)%p;
// If current (i.e. leftmost) bit = 1, multiply by a:
if(n < 0)
r = (a*r)%p;
// left-shift the exponent:
n <<= 1;
}
return r;
Quote:
|
||
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| (M48) NEW MERSENNE PRIME! LARGEST PRIME NUMBER DISCOVERED! | dabaichi | News | 571 | 2020-10-26 11:02 |
| Twin Prime Days, Prime Day Clusters | cuBerBruce | Puzzles | 3 | 2014-12-01 18:15 |
| disk died, prime work lost forever? where to put prime? on SSD or HDD? | emily | PrimeNet | 3 | 2013-03-01 05:49 |
| Prime Cullen Prime, Rest in Peace | hhh | Prime Cullen Prime | 4 | 2007-09-21 16:34 |
| The 40th known Mersenne prime, 220996011-1 is not PRIME! | illman-q | Miscellaneous Math | 33 | 2004-09-19 05:02 |