OFFSET
1,4
COMMENTS
k^2 + k + n for even n is always even and > 2, so is never prime.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
For n=1, k^2+k+1 is prime for k=1, since it is 3.
For n=7, k^2+k+7 is not prime for k=1, but is prime for k=2, since it is 13.
MATHEMATICA
lpik[n_]:=Module[{k=1}, While[!PrimeQ[k^2+k+n], k++]; k]; Table[lpik[n], {n, 1, 181, 2}] (* Harvey P. Dale, Sep 24 2017 *)
PROG
(PARI) lista(nn) = {forstep (n=1, nn, 2, k = 1; while(! isprime(k*k + k + n), k++); print1(k, ", "); ); } \\ Michel Marcus, May 18 2013
(PARI) a(n)=my(k=1); while(!isprime(k^2+k+2*n-1), k++); k \\ Charles R Greathouse IV, May 19 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Joseph L. Pe, Jan 09 2003
STATUS
approved