A357362 Primes q such that either p^(q-1) == 1 (mod q^2) or q^(p-1) == 1 (mod p^2), where p = A151799(q).
7, 53, 59, 151057, 240733, 911135857
Offset: 1
Programs
-
PARI
is(n) = my(b=precprime(n-1)); Mod(b, n^2)^(n-1)==1 || Mod(n, b^2)^(b-1)==1 forprime(p=3, , if(is(p), print1(p, ", ")))
-
Python
from sympy import nextprime from itertools import islice def agen(): p, q = 2, 3 while True: if pow(p, q-1, q*q) == 1 or pow(q, p-1, p*p) == 1: yield q p, q = q, nextprime(q) print(list(islice(agen(), 5))) # Michael S. Branicky, Sep 30 2022
Extensions
a(6) from Michael S. Branicky, Sep 26 2022