login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A354155 Lagrange primes: primes p == 1 (mod 4) such that X = (p-1)/2 is the least solution in the interval [1, (p-1)/2] of the congruence (X!)^2 == -1 (mod p). 2
5, 13, 17, 29, 41, 53, 73, 97, 137, 229, 241, 257, 281, 313, 397, 409, 449, 457, 461, 521, 541, 617, 653, 661, 677, 733, 769, 809, 853, 857, 929, 953, 997, 1021, 1069, 1109, 1201, 1213, 1217, 1249, 1277, 1361, 1373, 1409, 1489, 1553, 1597, 1609, 1621, 1697 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
REFERENCES
J. B. Cosgrave, A Mersenne-Wieferich Odyssey, Manuscript, May 2022. See Section 18.5.
LINKS
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 all(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
(PARI) is(n)=if(n%4 != 1 || !isprime(n), return(0)); my(t1=lift(sqrt(Mod(-1, n))), t2=n-t1, t=Mod(1, n)); for(k=2, n\2, if(t==t1 || t==t2, return(0)); t*=k); 1 \\ Charles R Greathouse IV, Aug 03 2023
(PARI) list(lim)=my(v=List()); forprimestep(p=5, lim\1, 4, my(t1=lift(sqrt(Mod(-1, p))), t2=p-t1, t=Mod(1, p)); for(k=2, p\2, if(t==t1 || t==t2, next(2)); t*=k); listput(v, p)); Vec(v) \\ Charles R Greathouse IV, Aug 03 2023
CROSSREFS
Sequence in context: A307096 A283391 A145016 * A123079 A273950 A268511
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 29 2022, based on Section 18.5 of Cosgrave (2022)
EXTENSIONS
a(20) and beyond from Michael S. Branicky, May 30 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 10 07:40 EDT 2024. Contains 372358 sequences. (Running on oeis4.)