login
A078770
a(n) = the least positive integer k such that k^2 + k + N is prime, where N is the n-th positive odd integer.
1
1, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 2, 2, 1, 1, 2, 4, 1, 2, 1, 1, 5, 1, 2, 3, 1, 2, 2, 1, 1, 2, 4, 1, 2, 1, 1, 2, 7, 1, 5, 1, 2, 3, 1, 3, 2, 4, 1, 2, 1, 1, 2, 1, 1, 5, 1, 10, 3, 4, 3, 2, 7, 1, 3, 1, 2, 2, 1, 1, 3, 7, 2, 2, 1, 1, 2, 4, 1, 2, 4, 1, 5, 1, 2, 3, 1
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
Sequence in context: A210763 A281681 A218799 * A072038 A284315 A262928
KEYWORD
nonn
AUTHOR
Joseph L. Pe, Jan 09 2003
STATUS
approved