OFFSET
1,1
REFERENCES
J. B. Cosgrave, A Mersenne-Wieferich Odyssey, Manuscript, May 2022. See Section 18.5.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..5383
PROG
(Python)
from itertools import islice
from sympy import factorial, nextprime
def agen(): # generator of terms
p = 5
while True:
X = (p-1)//2
Xf = factorial(X)**2
if any(pow(factorial(Y), 2, p)+1 == p for Y in range(X-1, 0, -1)):
yield p
p = nextprime(p)
while p%4 != 1:
p = nextprime(p)
print(list(islice(agen(), 5))) # Michael S. Branicky, May 30 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 29 2022, based on Section 18.5 of Cosgrave (2022)
EXTENSIONS
a(26) and beyond from Michael S. Branicky, May 30 2022
STATUS
approved