cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A238242 Primes p such that p^2+p+41 is also prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 97, 101, 103, 107, 113, 131, 137, 139, 149, 151, 157, 167, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 241, 257, 263, 269, 277, 281, 293, 307, 311, 313, 317, 337, 353
Offset: 1

Views

Author

K. D. Bajpai, Feb 20 2014

Keywords

Comments

n^2 + n + 41 is Euler’s prime generating polynomial.
The first 12 terms in the sequence are the first 12 consecutive primes.

Examples

			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.
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(400)| IsPrime(p^2+p+41)]; // Vincenzo Librandi, Feb 22 2014
  • 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]&]
  • PARI
    s=[]; forprime(p=2, 1000, if(isprime(p^2+p+41), s=concat(s, p))); s \\ Colin Barker, Feb 20 2014