OFFSET
1,1
COMMENTS
n^2 + n + 41 is Euler’s prime generating polynomial.
The first 12 terms in the sequence are the first 12 consecutive primes.
LINKS
K. D. Bajpai, Table of n, a(n) for n = 1..3372
EXAMPLE
13 is in the sequence because 13 is prime and 13^2+13+41 = 223 is also prime.
113 is in the sequence because 113 is prime and 113^2+113+41 = 12923 is also prime.
MAPLE
with(numtheory):KD := proc() local a, b; a:=ithprime(n); b:=a^2+a+41; if isprime(b) then RETURN (a); fi; end: seq(KD(), n=1..500);
MATHEMATICA
Select[Prime[Range[200]], PrimeQ[#^2+#+41]&]
PROG
(PARI) s=[]; forprime(p=2, 1000, if(isprime(p^2+p+41), s=concat(s, p))); s \\ Colin Barker, Feb 20 2014
(Magma) [p: p in PrimesUpTo(400)| IsPrime(p^2+p+41)]; // Vincenzo Librandi, Feb 22 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
K. D. Bajpai, Feb 20 2014
STATUS
approved