A123271 Sign of the penultimate term of the Lucas-Lehmer sequence modulo the n-th Mersenne prime.
1, 1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, 1, -1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, -1
Offset: 2
Examples
From _Serge Batalov_, Feb 04 2013: (Start) For n=3, p=5, M_p=31, and the Lucas-Lehmer sequence is (4, 14, 8, 0). The penultimate element is 1*2^3 == 8 (mod 31), so a(3)=1. For n=4, p=7, M_p=127, and the Lucas-Lehmer sequence is (4, 14, 67, 42, 111, 0). The penultimate element is -1*2^4 == 111 (mod 127), so a(4)=-1. (End)
Links
- Bastiaan Jansen, Mersenne primes and class field theory. Doctoral thesis, Leiden University, 2012.
- Mersenne Forum, Penultimate Lucas-Lehmer step
- Eric Weisstein's World of Mathematics, Lucas-Lehmer test
Programs
-
PARI
test(p)=s=Mod(4, 2^p-1); for(i=1, p-3, s=s^2-2); r=2^((p+1)/2); if(s==+r,+1,s==-r,-1,"error") \\ Then a(n) = test(A000043(n)). From Jeppe Stig Nielsen, Jan 25 2016
Formula
Extensions
More terms from Andreas Höglund, Sep 29 2007
a(40) added by Max Alekseyev, Feb 07 2011
a(41)-a(46) and prospective a(47)-a(48) from Andreas Höglund via Serge Batalov, Feb 04 2013; Max Alekseyev, Feb 25 2018
a(47) added by Gord Palameta, Dec 21 2018
a(48) added by Gord Palameta, Oct 21 2024
Comments