- **Miscellaneous Math**
(*https://www.mersenneforum.org/forumdisplay.php?f=56*)

- - **Mersenne factors 2*k*p+1**
(*https://www.mersenneforum.org/showthread.php?t=26057*)

Mersenne factors 2*k*p+1All primes q>3 can be written on the form q=2*k*p + 1 for some k>0 and some prime p, and many primes q can be written like that in several different ways.
The number of different ways is the number of the distinct prime factors of (q-1)/2. Each distinct prime factor can be the prime p in k*p and then (q-1)/(2*p) is the k value. Not all primes q=2kp+1 is the factor of a Mersenne number with prime exponent p, and those that are a factor, can only be the factor of 1 Mersenne number. To be a factor the prime q (mod 120) must be equal to one of these 16 values: 1 7 17 23 31 41 47 49 71 73 79 89 97 103 113 119 Close to half of all primes satisfies this requirement but not all of those are factors. I was curious how many of those are Mersenne factors. I checked all factors in the GIMPS database < 10[SUP]9[/SUP], which is all there is < 10[SUP]9[/SUP] since the smallest factor outside GIMPS range would be roughly 2*10[SUP]9[/SUP]. 2kp+1 with k=1 and p>10[SUP]9[/SUP]. Here is the data, the primes%120 column is the number of primes satisfying the mod 120 requirements. I included the 6 Mersenne primes: M3=7, M5=31, M7=127, M13=8191, M17=131071, M19=524287 in the Mersenne factors column since they are really their own factors. Not surprisingly the ratio of Mersenne factors to primes goes down with size. The percentages are the ratio of Mersenne factors to the primes%120 column. [CODE]n Total primes primes%120 Mersenne factors 10[SUP]2[/SUP] 25 11 4 36.36% 10[SUP]3[/SUP] 168 80 20 25.00% 10[SUP]4[/SUP] 1229 603 103 17.08% 10[SUP]5[/SUP] 9592 4783 583 12.19% 10[SUP]6[/SUP] 78498 39221 3842 9.80% 10[SUP]7[/SUP] 664579 332213 26556 7.99% 10[SUP]8[/SUP] 5761455 2880376 196645 6.83% 10[SUP]9[/SUP] 50847534 25422922 1511498 5.95%[/CODE] |

[QUOTE=ATH;559190]To be a factor the prime q (mod 120) must be equal to one of these 16 values:
1 7 17 23 31 41 47 49 71 73 79 89 97 103 113 119[/QUOTE] which can be simplified to q mod 8 = 1 or 7 |

[QUOTE=axn;559193]which can be simplified to q mod 8 = 1 or 7[/QUOTE]
No, the 16 values (mod 120) are more restrictive. +/- 1 (mod 8) would give 30 values (mod 120): 1 7 9 15 17 23 25 31 33 39 41 47 49 55 57 63 65 71 73 79 81 87 89 95 97 103 105 111 113 119 |

[QUOTE=axn;559193]which can be simplified to q mod 8 = 1 or 7[/QUOTE]
That's true, but using a higher modulo sieves-out little bit more of the composites, such as 9 mod 120. |

You are both correct, the extra 14 values are just the trivial composites mod 3 and mod 5. Did not really think about that, I just always used the 16 values (mod 120), but I could have also used +/- 1 (mod 8).
Good thing I posted in Misc. Math thread then. |

[QUOTE]You are both correct, the extra 14 values are just the trivial composites mod 3 and mod 5. Did not really think about that, I just always used the 16 values (mod 120), but I could have also used +/- 1 (mod 8).
Good thing I posted in Misc. Math thread then.[/QUOTE] this kind of math got my brain cooked in a matter of seconds |

Mod 120 doesn't bring any benefit compared with mod 60. The next values which bring benefits are 420, 4620, etc (what mfaktX use, they are primorials times 2).
The idea is that mersenne factors are 2kp+1 and 1 or 7 mod 8, so if you want to filter out whole classes, then the total number of classes must be multiple of 4 (so 2kp be multiple of 8). That is why we use 4, 12, 60, 420, 4620, etc. classes. There are some posts on this forum where I put some pari/gp TF code with all those number of classes, shown how much faster is one compared with another, etc., and there were more explanations there. |

Here's a [URL="https://www.mersenneforum.org/showthread.php?p=536943"]starting point[/URL] (follow links there)
[URL="https://mersenneforum.org/showthread.php?t=17126"]Pari scripts[/URL] (fun starts in post #32, then see all discussion after, till the parallelization from Hans, post #118, and the end of the topic). |

All times are UTC. The time now is 02:29. |

Powered by vBulletin® Version 3.8.11

Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.