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.

A189051 Numbers n such that n+/-2 and n^2+/-2 are all primes.

This page as a plain text file.
%I A189051 #21 Sep 08 2022 08:45:56
%S A189051 9,15,21,309,441,1611,2955,3081,3879,5529,7209,7755,7875,13761,15015,
%T A189051 15729,16659,21561,22155,35595,37059,38199,45291,50049,51429,59619,
%U A189051 63855,67215,67941,71331,72891,83061,96459,96909,102795,106959,111495
%N A189051 Numbers n such that n+/-2 and n^2+/-2 are all primes.
%H A189051 Robert Israel, <a href="/A189051/b189051.txt">Table of n, a(n) for n = 1..10000</a>
%F A189051 Intersection of A087679 and A108701.
%p A189051 select(n -> isprime(n-2) and isprime(n+2) and isprime(n^2-2) and isprime(n^2+2),
%p A189051 [seq(i,i=3..10^6, 6)]); # _Robert Israel_, Jun 23 2017
%t A189051 pQ[n_]:=Module[{n2=n^2},And@@PrimeQ[{n+2,n-2,n2+2,n2-2}]]; Select[Range[ 120000],pQ] (* _Harvey P. Dale_, Jun 04 2011 *)
%o A189051 (PARI) forstep(n=3,100000,6,if(isprime(n-2)&isprime(n+2)&isprime(n^2-2)&isprime(n^2+2),print1(n", ")))
%o A189051 (Magma) [n: n in [1..2000000]|IsPrime(n-2)and IsPrime(n+2)and IsPrime(n^2-2)and IsPrime(n^2+2)]; // _Vincenzo Librandi_, Apr 20 2011
%Y A189051 Cf. A087679, A108701.
%K A189051 nonn
%O A189051 1,1
%A A189051 _Juri-Stepan Gerasimov_, Apr 16 2011
%E A189051 Corrected and extended by _Franklin T. Adams-Watters_, Apr 16 2011