OFFSET
4,1
COMMENTS
Smallest p = prime(i) such that at least one of p-n or p+n occurs in the i-th row of A244249.
a(2) = 5. a(3) and a(23) are larger than 10^8 if they exist.
a(3) > 10^10, a(23) > 75*10^8. - Robert G. Wilson v, Dec 16 2016
LINKS
EXAMPLE
For n = 4: p = 257 satisfies b^(p-1) == 1 (mod p^2) for b = p+4 = 261, i.e., 261^256 == 1 (mod 257^2) and is the smallest such p, so a(4) = 257.
MATHEMATICA
f[n_] := Block[{p = NextPrime[n +1]}, While[ PowerMod[p - n, p -1, p^2] != 1 && PowerMod[p + n, p -1, p^2] != 1, q = p = NextPrime@ p]; p] (* Robert G. Wilson v, Dec 14 2016 *)
PROG
(PARI) a(n) = forprime(p=n+2, , my(b=p-n, c=p+n); if(Mod(b, p^2)^(p-1)==1 || Mod(c, p^2)^(p-1)==1, return(p)))
CROSSREFS
KEYWORD
nonn,hard,more
AUTHOR
Felix Fröhlich, Dec 11 2016
STATUS
approved