OFFSET
1,1
COMMENTS
a(n) != 13 (mod 20) and a(n) != 17 (mod 20). Proof: Write n=20*k + 13, and then show that n^2 + 1 == 0 (mod 5) and 3^(n+1) - 1 == 3 (mod 5). Because of its factor 5 the former cannot divide the latter. - Martin Ehrenstein, Jun 06 2021
a(6) > 10^14. - Martin Ehrenstein, Jun 18 2021
MATHEMATICA
a[n_Integer] := Select[ Prime@ Range@n, PowerMod[3, # + 1, #^2 + 1] == 1 &]; a[2*10^5] (* or *)
a[n_Integer] := If[ PrimeQ@n && Divisible[3^(n + 1) - 1, n^2 + 1] , Print@n]; Do[ a[n], {n, 2*10^5}]
PROG
(Python)
from sympy import primerange
def afind(limit):
for p in primerange(1, limit+1):
if pow(3, p+1, p**2+1) == 1: print(p, end=", ")
afind(10**6) # Michael S. Branicky, May 03 2021
CROSSREFS
KEYWORD
nonn,hard,more
AUTHOR
Mikk Heidemaa, Apr 28 2021
STATUS
approved