login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A273775
Smallest prime p > n + 1 where a base b exists with abs(b - p) = n such that b^(p-1) == 1 (mod p^2).
1
257, 23, 13, 229, 11, 13, 13, 599, 29, 109, 541, 29, 83, 4099, 2011, 23, 47, 2042851, 115981
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
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
Cf. A244249.
Sequence in context: A004217 A351309 A051333 * A182912 A276233 A252726
KEYWORD
nonn,hard,more
AUTHOR
Felix Fröhlich, Dec 11 2016
STATUS
approved