![]() |
It seems to work, but why ?
With the following, I'm able to find divisors of Mersenne numbers.
It is surely not useful, because it is MUCH slower than dividing Mersenne numbers by candidate divisors. But I do not understand why it works. Do you have an idea ? Tony Look at the following PARI/gp code. LLT(p,m) is a routine that computes several values (up to a maximum m) like the LLT does: x=-5 is the starting value, then it applies : [tex]x = (-2x-3) \ \bmod{p}[/tex]. When [tex]x \equiv 0 \ \pmod{p}[/tex], it stops and returns the number of iterations done. LLT2(q) enumerates all prime candidate divisors of Mq and calls LLT(p,q) for finding how many iterations (i) are required before x=0. It is a success if x=0 is found after q-2 iterations. (There are some rare cases where x=0 after a number of iterations different than q-2) I've experimented with the following values of q: 11, 13, 17, 23, 29, 31, 41, 43, 47, 53, 59, 89 (not finished for 89), and the result is always: - if Mq is prime, then LLT2 never succeeds (no divisor p is found). - if Mq is composite, then LLT2 finds divisors of Mq, and only them. It seems to be a miracle (or an evidence, or my mistake ?). As an example, for q=53, it finds the 3 divisors of M_53: 6361, 69431 and 20394401. LLT(p,m)= { x=-5; for(i=1,m, x=(-2*x-3)%p; if(x == 0, return(i)); ); return(0); } LLT2(q)= { print(q); for(i=1, sqrt(2^q-1)/2/q, p=1+2*q*i; if(isprime(p), j=LLT(p,q); if(j==q-2, print(i," ", 1+2*q*i, " ",j), if(j!=0, print("# ", j)) ); ); ); } LLT2(11) LLT2(13) LLT2(17) LLT2(19) LLT2(23) LLT2(29) LLT2(31) LLT2(41) LLT2(43) LLT2(47) LLT2(53) LLT2(59) LLT2(89) LLT2(101) |
This isn't a miracle!
Let x(0)=-5 and x(n)=-2*x(n-1)-3 mod p. New variable: let y(n)=x(n)+1. So y(0)=-4 and y(n)-1=-2*(y(n-1)-1)-3 mod p from this: y(n)=-2*y(n-1) mod p so x(n)=y(n)-1=(-2)^n*y(0)-1=-(-2)^(n+2)-1 mod p. It is easy to see that LT(p,m)=i if and only if i<=m and i is the smallest solution of x(n)=0 mod p or i=0 if it hasn't got a solution up to m. Suppose that q is prime then every prime divisor of Mq is of the form p=1+2*q*i; where i>=1 is an integer and we can suppose that p<sqrt(Mq) so i<sqrt(2^q-1)/2/q. Case 1.: Mq is prime ( q>2) . If LLT2 find a value : p=1+2*q*i and LLT(p,q)=q-2 so -(-2)^(q-2+2)-1=0 mod p, but q=1 mod 2 so 2^q=1 mod p from this p is a prime divisor of 2^q-1 and 1<p<sqrt(Mq) so it is a proper divisor of Mq, but Mq is prime this is a contradiction. Case2.: Mq is composite. If LLT2 find a value p=1+2*q*i and LLT(p,q)=q-2, then we have seen that p is a prime divisor of Mq. And it is also true that if p<sqrt(Mq) and p is a prime divisor of Mq then LLT2 will find this p: x(q-2)=0 mod p because 2^q=1 mod p, if LLT2=i<q-2 so x(i)=0 mod p then -(-2)^(i+2)-1=0 mod p from this (-2)^(i+1)=-1 mod p // ^2 mod p we get 2^(2*(i+1))=1 mod p but 2^q=1 mod p is also true ( here q is prime ) so the order of 2 modulo p is 1, it is a contradiction ( 2^1=1 modulo p isn't possible ). So LLT will find all prime divisors of Mq and only them. ( up to the square root of Mq ). |
Study the iteration without the mod. The negative signs are distracting, so take it 2 steps at a time,
F[sub]2k[/sub](x) = 4 * F[sub]2k-2[/sub](x)+3 It's not hard to show that F[sub]2k[/sub](x) = 2[sup]2k[/sup](x+1)-1 Hence F[sub]2k+1[/sub](x) = -2[sup]2k+1[/sup](x+1)-1 When x=-5, this is F[sub]2k+1[/sub](-5) = 2[sup]2k+3[/sup]-1 So the value, without any mod operations, is exactly the Mersenne Number at iteration "q-2." When the prime divides the Mersenne number, the mod is of course zero. |
Too stupid I am, sometimes ...
Yes, it is not a miracle.
I've been a kind of stupid: I was studying LLT-like formula modulo Mq : x=(a*x^2+b*x+c)(mod Mq). And, with a=0, I did not think about looking at the numbers x without the modulo ... which are the Mersenne numbers. Thanks for opening my eyes ! Tony |
Some LLT-like tests for Mersenne
The following formula seem to provide the same kind of primality test for Mersenne than the LLT does.
Why ? [tex]S_0=1 \ ,\ S_{i+1}=6S_i^2-6S_i+2[/tex] . [tex]M_q \text{ prime iff } S_{q-1} \equiv 0 \ \pmod{M_q}[/tex] [tex]S_0=5 \ ,\ S_{i+1}=2S_i^2-1[/tex] . [tex]M_q \text{ prime iff } S_{q-2} \equiv 0 \ \pmod{M_q}[/tex] [tex]S_0=6 \ ,\ S_{i+1}=(S_i-2)^2[/tex] . [tex]M_q \text{ prime iff } S_{q-1} \equiv 0 \ \pmod{M_q}[/tex] |
Tony, I may have mis-read your post but according to your bottom line, if you start with
[tex]\large S_{0}\,=\,6,\;S_{1}\,=\,S_{0}-2^{2}[/tex] then you get: [tex]\large (6-2)^2\,=\,16,\;(16-2)^2\,=\,196,\;(196-2)^2\,=37636[/tex] etc. this last has the factors 2, 2, 97, 97 which does not seem to fit very well with a test for division by a Mersenne number. The LL number 37634 on the other hand has the factors 2, 31, 607 which does fit with Mersennes, so I‘m wondering if maybe there’s a typo in your post. |
A family of different LLT-like primality tests for Mersennes ?
Hi Numbers,
About the third formula, if you say: [tex]\large x_0=4 \ ,\ llt(x_{i+1})=x_i^2-2[/tex] and [tex]\large x_0=6 \ ,\ f_3(x_{i+1})=(x_i-2)^2[/tex], then you see that: [tex]\large f_3(x_{i+1})=\big(llt(x_i)\big)^2[/tex] . So there is no miracle. Better, if you define: [tex]\large x_0=2 \ ,\ F(x_{i+1})=2x_i^2-1[/tex], then you produce the numbers: 7, 97, 31*607, ... that appear with the LLT and f_3. But, if you look at second formula: [tex]\large x_0=5 \ ,\ F_5(x_{i+1})=2x_i^2-1[/tex], which is the same than F(x), but with a different x_0, you get: 7^2, 4801, 31*1487071, 52609*80789839489, 127*769*36810112513*10050007226929279, ... . So this F_5 function generates different numbers but it still acts as a LLT-like test (PARI code): F5(q)=x=2; for(i=1,q,x=(2*x^2-1)%(2^q-1);if(x==0,print(i))) Notice that the function [tex]\large F(x_{i+1})=2x_i^2-1[/tex] mimics the look of Mersenne numbers: [tex]\large 2*(2^x)^2-1 [/tex]. About the first formula: [tex]\large x_0=1 \ ,\ f_1(x_{i+1})=6x_i(x_i-1)+2[/tex], it produces different numbers: 2, 2*7, 2*547, 2*7*31*61*271, 2*6883*22434744889, 2*7*19*37*43*127*547*883*2269*2521*550554229, ... and it also looks like it is still a LLT-like primality test for Mersenne numbers. f1(q)=x=1;for(i=1,q,x=(6*x*(x-1)+2)%(2^q-1);if(x==0,print(i))). It should be possible to prove that F_5 and f_1 are really LLT-like primality tests for Mersenne numbers, by using method described by P. Ribenboim in his book. I'll have a look. More comments ? Tony |
[QUOTE=T.Rex]It should be possible to prove that F_5 and f_1 are really LLT-like primality tests for Mersenne numbers, by using method described by P. Ribenboim in his book. I'll have a look.[/QUOTE] The methods used by Lucas and Lehmer do not apply for F_5 and f_1. Tony
|
Tony,
I know this is going to sound trivially obvious, but all you have is (x+2-2)^2 = x^2 You have one sequence starts with a 4, and goes (x^2)-2 Then you have another sequence starting with a 6, going: (y-2)^2 So the second sequence is just (x+2-2)^2 which is pretty obviously x^2 I can’t believe you haven’t already seen this, but there doesn’t appear to be a better answer to why it happens. |
FWIW, the closed form solution of the first itereation is
S[sub]n[/sub] = (3[sup]2[sup]n[/sup][/sup])/6 + 1/2 Using the MersenneWiki explication of Lucas-Lehmer as a guide, it looks interesting to investigate the order of 3 mod Q - but I don't how. |
[QUOTE=Numbers]I can’t believe you haven’t already seen this, but there doesn’t appear to be a better answer to why it happens.[/QUOTE]In fact (and this happens too often), I realized my mistake once I have posted and switched off my PC and was ready to sleep. It it what I explain in first part of my post #7 about llt and f3. They are 2 different formula for the same kind of numbers.
About F5 and f1 in #7, I've read again papers. Based on Ribenboim work, they cannot be proved by usual technics because we must have: [tex]\large S_{i+1} < S_i^2[/tex]. This comes from a property of Lucas Sequences: [tex]\large V_{2n} = V_n^2 -2Q^n[/tex]. When n=2k. Tony |
That will teach you for switching your PC off. You should have it running 24/7 with prime95 using it while you are asleep.
|
[QUOTE=T.Rex]The methods used by Lucas and Lehmer do not apply for F_5 and f_1. Tony[/QUOTE]I was wrong.
Based on Lehmer technics and on my own previous work, I think I have a proof for (LLRT ?): [tex]\large \ \ \ \ M_q \text{ is a prime iff } M_q \ \mid \ S_{q-2} \text{ where: } S_0=5 \ , \ S_{i+1} = 2 S_i^2-1 [/tex] . The proof takes 1 page, based on theorems appearing in Williams' book. I'll write it in [tex]L_AT_EX[/tex] asap in order to check I did not make any mistake, and then I will provide a link to my web-site, so that everyone can check the proof. (I really prefer that test rather than the LLT, because it mimics the form of Mersenne numbers: [tex]M_q = 2 (2^x)^2-1 [/tex] ! Also, their computing costs are quite identical.) Tony |
A proof of a new (AFAIK) Primality test for Mersenne numbers.
Hi all,
Here is a draft of the [URL=http://tony.reix.free.fr/Mersenne/PrimalityTestMersenneNumbers.pdf]proof[/URL] of a new (AFAIK) primality test for Mersenne numbers, also based (like LLT) on Lucas Sequences and Lehmer theorems. (Should I name it: LLRT ?) I would appreciate early readers to check it. Do you think it is worth to propose it for publication in a Mathematic Journal ? It is close to the old LLT, but it flies through the Mersenne number space in a different way, producing different intermediate numbers and residues. Stay tuned, I will add some more properties. Also, I have to fix some minor mistakes in the [URL=http://tony.reix.free.fr/Mersenne/PrimalityTest2FermatNumbers.pdf]document[/URL] I refer to in the paper. For those who know nothing about Lucas Sequences and about Lucas-Lehmer theorems, just know that proving this theorem is easy, because Lucas and Lehmer have done the most difficult work. Thanks also to HC Williams for his wonderful book: "Edouard Lucas and Primality Testing". I think the most difficult part was to imagine that there could be a different way for proving primality of Mersenne numbers. Though providing a new primality proof for Mersenne numbers that has the same cost than LLT seems unuseful at first, I think that it may help the search of Mersenne primes and of Mersenne factors. Regards, Tony |
I think you waste your effort.
For Lucas Lehmer test x[0]=10 is also a good starting value, x[i+1]=x[i]^2-2. See [URL=http://primes.utm.edu/mersenne/]http://primes.utm.edu/mersenne/[/URL] Your Lucas sequence for Mersenne numbers is: s[0]=5, s[i+1]=2*s[i]^2-1. It is easy to prove ( by induction ) that s[n]=x[n]/2, so Mq divides s[q-2] if and only if Mq divides x[q-2] ( because Mq is odd) . So it is not a new discovery. |
[QUOTE=R. Gerbicz]I think you waste your effort ...[/QUOTE]You are perfectly right, and I've been (nearly) completely stupid. :redface: :redface: :redface:
(I thought to check that it produces different numbers, but I forgot to look at the other roots of LLT: [tex]\large U_0=4 \ ,\ U_{n+1}=U_n(U_n^2-3)[/tex] .) At least, I've found some mistakes in the second paper. Is this paper (LLT for Fermat numbers) correct ? or did I make another (big) mistake ? Thanks for your help ! Tony |
| All times are UTC. The time now is 07:58. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.