OFFSET
1,2
COMMENTS
After a(1), all the terms are multiples of 3.
After a(2), all the terms are congruent to 5 or 7 (mod 10).
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
a(2) = 3, {3 + 2 = 5, 3 + 4 = 7} and {3^2 + 2 = 11, 3^2 + 4 = 13} are twin prime pairs.
a(3) = 15, {15 + 2 = 17, 15 + 4 = 19} and {15^2 + 2 = 227, 15^2 + 4 = 229} are twin prime pairs.
MATHEMATICA
Select[Range[1000000], PrimeQ[# + 2] && PrimeQ[# + 4] && PrimeQ[#^2 + 2] && PrimeQ[#^2 + 4] &]
PROG
(PARI) for(n=1, 100000, 2; if(isprime(n+2) && isprime(n+4) && isprime(n^2+2) &&isprime(n^2+4), print1(n, ", ")))
(Magma) [n: n in [0..100000] | IsPrime(n+2) and IsPrime(n+4) and IsPrime(n^2+2) and IsPrime(n^2+4)];
(Scheme, with Antti Karttunen's IntSeq-library)
(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)))))))
;; Antti Karttunen, Apr 15 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
K. D. Bajpai, Mar 18 2017
STATUS
approved