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”).

A108151
a(n) = n^2 + 3*n + 1 if prime or 0 if composite.
0
5, 11, 19, 29, 41, 0, 71, 89, 109, 131, 0, 181, 0, 239, 271, 0, 0, 379, 419, 461, 0, 0, 599, 0, 701, 0, 811, 0, 929, 991, 0, 0, 0, 1259, 0, 0, 1481, 1559, 0, 1721, 0, 0, 1979, 2069, 2161, 0, 2351, 0, 2549, 0
OFFSET
1,1
EXAMPLE
1^2+3*1+1 = 5 prime so a(1) = 5.
2^2+3*2+1 = 11 prime so a(2) = 11.
6^2+3*6+1 = 55 = 5*11 composite so a(6) = 0.
MATHEMATICA
Table[t=n^2+3n+1; If[PrimeQ[t], t, 0], {n, 50}] (* James C. McMahon, Feb 21 2024 *)
CROSSREFS
Cf. A028387.
Sequence in context: A239732 A130828 A244241 * A209188 A356247 A215886
KEYWORD
nonn,less
AUTHOR
Pierre CAMI, Jun 06 2005
STATUS
approved