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.

A237360 Numbers n of the form p^2+p+1 (for prime p) such that n^2+n+1 is also prime.

This page as a plain text file.
%I A237360 #17 Feb 09 2014 10:20:08
%S A237360 57,381,993,4557,16257,32943,49953,58323,109893,135057,167691,214833,
%T A237360 237657,453603,503391,564753,658533,678153,780573,995007,1248807,
%U A237360 1516593,1746363,2218611,2400951,3465183,3738423,4340973,4750221,5232657,6118203
%N A237360 Numbers n of the form p^2+p+1 (for prime p) such that n^2+n+1 is also prime.
%H A237360 Harvey P. Dale, <a href="/A237360/b237360.txt">Table of n, a(n) for n = 1..10000</a>
%e A237360 57 = 7^2+7+1 (7 is prime) and 57^2+57+1 = 3307 is also prime. Thus, 57 is a member of this sequence.
%p A237360 for k from 1 do
%p A237360     p := ithprime(k) ;
%p A237360     n := numtheory[cyclotomic](3,p) ;
%p A237360     pn := numtheory[cyclotomic](3,n) ;
%p A237360     if isprime( pn) then
%p A237360         print(n) ;
%p A237360     end if;
%p A237360 end do: # _R. J. Mathar_, Feb 07 2014
%t A237360 Select[Table[p^2+p+1,{p,Prime[Range[500]]}],PrimeQ[#^2+#+1]&] (* _Harvey P. Dale_, Feb 09 2014 *)
%o A237360 (Python)
%o A237360 import sympy
%o A237360 from sympy import isprime
%o A237360 {print(n**2+n+1) for n in range(10**4) if isprime(n) and isprime((n**2+n+1)**2+(n**2+n+1)+1)}
%o A237360 (PARI) s=[]; forprime(p=2, 4000, if(isprime(p^4+2*p^3+4*p^2+3*p+3), s=concat(s, p^2+p+1))); s \\ _Colin Barker_, Feb 07 2014
%Y A237360 Cf. A060800, A002383.
%K A237360 nonn
%O A237360 1,1
%A A237360 _Derek Orr_, Feb 06 2014