login
Numbers k such that {k + 2, k + 4} and {k^2 + 2, k^2 + 4} are both twin prime pairs.
1

%I #27 Sep 08 2022 08:46:19

%S 1,3,15,57,147,2085,6687,6957,11055,15267,17385,17577,20505,20637,

%T 23667,26247,31077,31317,32115,32967,34497,39225,47775,52065,53715,

%U 55335,56205,58365,62187,63585,66567,67215,70875,77235,77475,82005,85827,89595,89817,107505

%N Numbers k such that {k + 2, k + 4} and {k^2 + 2, k^2 + 4} are both twin prime pairs.

%C After a(1), all the terms are multiples of 3.

%C After a(2), all the terms are congruent to 5 or 7 (mod 10).

%H Amiram Eldar, <a href="/A284014/b284014.txt">Table of n, a(n) for n = 1..10000</a>

%e a(2) = 3, {3 + 2 = 5, 3 + 4 = 7} and {3^2 + 2 = 11, 3^2 + 4 = 13} are twin prime pairs.

%e a(3) = 15, {15 + 2 = 17, 15 + 4 = 19} and {15^2 + 2 = 227, 15^2 + 4 = 229} are twin prime pairs.

%t Select[Range[1000000], PrimeQ[# + 2] && PrimeQ[# + 4] && PrimeQ[#^2 + 2] && PrimeQ[#^2 + 4] &]

%o (PARI) for(n=1, 100000,2; if(isprime(n+2) && isprime(n+4) && isprime(n^2+2) &&isprime(n^2+4), print1(n, ", ")))

%o (Magma) [n: n in [0..100000] | IsPrime(n+2) and IsPrime(n+4) and IsPrime(n^2+2) and IsPrime(n^2+4)];

%o (Scheme, with Antti Karttunen's IntSeq-library)

%o (define A284014 (MATCHING-POS 1 1 (lambda (n) (and (= 1 (A010051 (+ n 2))) (= 1 (A010051 (+ n 4))) (= 1 (A010051 (+ (* n n) 2))) (= 1 (A010051 (+ (* n n) 4)))))))

%o ;; _Antti Karttunen_, Apr 15 2017

%Y Appears to be the intersection of A086381 and A256388, but that may be unproven.

%Y Cf. A000040, A001359, A007591, A010051, A067201, A178336, A178337.

%K nonn

%O 1,2

%A _K. D. Bajpai_, Mar 18 2017