OFFSET
1,1
COMMENTS
Smallest prime of form (n^2)*k+1, i.e., an arithmetic progression with n^2 differences; k is the subscript of the progressions.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..500 from Robert Price)
EXAMPLE
a(5) = 101 because in 5^2k + 1 = 25k + 1 progression k=4 generates the smallest prime (this is 101) and 26, 51, and 76 are composite.
MATHEMATICA
With[{prs=Prime[Range[2500]]}, Flatten[Table[Select[prs, Mod[#-1, n^2]==0&, 1], {n, 50}]]] (* Harvey P. Dale, Sep 22 2021 *)
PROG
(PARI) a(n) = if(n == 1, 2, my(s = n^2); forprime(p = 1, , if(p % s == 1, return(p)))); \\ Amiram Eldar, Mar 16 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved
