login
Numbers n such that n + 15 and n^2 + 15 are prime.
4

%I #13 Jun 08 2023 12:53:49

%S 2,4,8,14,16,22,26,32,38,44,46,52,64,68,86,88,98,124,134,158,178,184,

%T 196,212,236,242,248,256,262,296,298,316,322,338,364,374,386,394,452,

%U 472,484,488,548,578,586,598,602,626,632,638,646,658,662,676,694,718,728,736,794,806,842,848,862

%N Numbers n such that n + 15 and n^2 + 15 are prime.

%H Robert Israel, <a href="/A253142/b253142.txt">Table of n, a(n) for n = 1..10000</a>

%e 2 + 15 = 17 and 2^2 + 15 = 19 are both prime, so 2 is in the sequence.

%p select(t -> isprime(t+15) and isprime(t^2+15), [seq(i,i=2..1000,2)]); # _Robert Israel_, May 07 2019

%t p = 15; Select[Range[2,1000,2], PrimeQ[p + #^2] && PrimeQ[p + #] &]

%t Select[Range[2,1000,2],AllTrue[{#,#^2}+15,PrimeQ]&] (* _Harvey P. Dale_, Jun 08 2023 *)

%Y Intersection of A086303 and A121982.

%K nonn

%O 1,1

%A _Zak Seidov_, Dec 27 2014