%I #50 Jun 13 2022 03:02:25
%S 3,5,13,31,61,127,2203,4253,9941,19937,23209,86243,110503,132049,
%T 756839,1398269,2976221,3021377,6972593,13466917,20996011,25964951,
%U 37156667,43112609,77232917
%N Let M_p = 2^p-1 be a Mersenne prime, where p is an odd prime. Sequence lists p such that b_{p-2} == 2^((p+1)/2) mod M_p, where {b_k} is defined in the Comments.
%C Let M_p = 2^p-1 (not necessarily a prime) where p is an odd prime, and define b_1 = 4; b_k = b_{k-1}^2 - 2 (mod M_p) for k >= 2.
%C The Lucas-Lehmer theorem says that M_p is a prime iff b_{p-1} == 0 (mod M_p).
%C Furthermore, if M_p is a prime, then b_{p-2} is congruent to +- 2^((p+1)/2) (mod M_p).
%C This partitions the Mersenne prime exponents A000043 into two classes, listed here and in A354168.
%D J. B. Cosgrave, A Mersenne-Wieferich Odyssey, Manuscript, May 2022. See Section 16.1.
%H Mersenneforum, <a href="https://mersenneforum.org/showpost.php?p=502204&postcount=39">data for all known Mersenne penultimate residues (up to M#51)</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Lucas%E2%80%93Lehmer_primality_test#Sign_of_penultimate_term">Lucas-Lehmer primality test. Sign of penultimate term</a>
%Y Cf. A000043, A000668, A354168.
%Y Cf. A123271 (sign of the penultimate term of the Lucas-Lehmer sequence).
%K nonn,more
%O 1,1
%A _N. J. A. Sloane_, Jun 02 2022, based on Section 16.1 of Cosgrave (2022)
%E Thanks to _Chai Wah Wu_ for several corrections. - _N. J. A. Sloane_, Jun 02 2022
%E a(15) from _Chai Wah Wu_, Jun 04 2022
%E a(16)-a(25) from _Serge Batalov_, _Jun 11 2022