login
Numbers n such that n^2 + 1 and (n^2+2)/6 are both primes.
2

%I #18 Sep 08 2024 16:32:10

%S 4,10,16,20,26,56,110,116,170,224,236,314,326,340,430,584,700,764,920,

%T 946,1054,1106,1276,1294,1406,1546,1550,1654,1684,1700,1756,1766,1784,

%U 1816,2006,2026,2116,2260,2294,2314,2320,2360,2576,2600,2684,2746,2770,2924

%N Numbers n such that n^2 + 1 and (n^2+2)/6 are both primes.

%C n==2 or 4 (mod 6) so that (n^2+2)/6 is an integer. - _Robert Israel_, May 03 2017

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

%e 4 is in the sequence because 4^2+1 = 17 and (4^2+2)/6 = 3 are both primes.

%p select(t -> isprime(t^2+1) and isprime((t^2+2)/6), [seq(seq(6*j+k,k=[2,4]),j=0..1000)]); # _Robert Israel_, May 03 2017

%t Select[Range[3000], PrimeQ[(#^2+1)]&&PrimeQ[(#^2+2)/6]&]

%t Select[Range[3000],AllTrue[{#^2+1,(#^2+2)/6},PrimeQ]&] (* _Harvey P. Dale_, Sep 08 2024 *)

%Y Cf. A005574, A002496.

%K nonn

%O 1,1

%A _Michel Lagneau_, Aug 10 2012