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.

A247271 Numbers n such that n^2+1 and 2*n^2+1 are both prime numbers.

Original entry on oeis.org

1, 6, 24, 36, 66, 156, 204, 240, 264, 300, 306, 474, 570, 636, 750, 864, 936, 960, 1146, 1176, 1290, 1494, 1524, 1716, 1974, 2034, 2136, 2310, 2406, 2706, 2736, 2964, 3156, 3240, 3624, 3756, 3774, 3900, 3984, 4026, 4080, 4524, 4530, 4554, 4590, 4644, 4650, 4716
Offset: 1

Views

Author

Michel Lagneau, Sep 11 2014

Keywords

Comments

Numbers n such that A002522(n) and A058331(n) are prime numbers.
a(n)==0 mod 6 because the primes n^2+1 and 2*n^2+1 are congruent to 1 (mod 6).
The corresponding pairs of primes (n^2+1,2*n^2+1) are (2,3), (37,73), (577, 1153), (1297,2593), (4357,8713), (24337,48673), ...

Examples

			a(2)=6 because A002522(6)=37 and A058331(6)=73 are both prime numbers.
		

Crossrefs

Programs

  • Magma
    [n: n in [0..5000] | IsPrime(n^2+1) and IsPrime(2*n^2+1)]; // Vincenzo Librandi, Sep 14 2014
  • Maple
    A247271:=n->`if`(isprime(n^2+1) and isprime(2*n^2+1), n, NULL): seq(A247271(n), n=1..10^4); # Wesley Ivan Hurt, Sep 12 2014
  • Mathematica
    lst={}; Do[p=n^2+1; q=2n^2+1; If[PrimeQ[p] && PrimeQ[q], AppendTo[lst, n]], {n, 5000}]; lst
  • PARI
    for(n=1,10^4,if(isprime(n^2+1)&&isprime(2*n^2+1),print1(n,", "))) \\ Derek Orr, Sep 11 2014