OFFSET
1,1
COMMENTS
Subsequence of A243761.
How is the distribution of terms of this sequence? With this form p^2 + pq + q^2, do twin primes generate bigger twin primes infinitely many times?
EXAMPLE
109 is a term because 109 and 107 are twin primes and 109 = 5^2 + 5*7 + 7^2, 5 and 7 are also twin primes.
433 is a term because 433 and 431 are twin primes and 433 = 11^2 + 11*13 + 13^2, 11 and 13 are also twin primes.
PROG
(PARI) t(n, p=3) = {while( p+2 < (p=nextprime( p+1 )) || n-->0, ); p-2}
for(n=1, 1e3, if(ispseudoprime(P=(3*t(n)^2 + 6*t(n) + 4)) && ispseudoprime(P-2), print1(P, ", ")));
(Python)
from itertools import islice
from sympy import isprime, nextprime
def A270249_gen(): # generator of terms
p, q = 2, 3
while True:
if q-p == 2 and isprime(s:=3*p*q+4) and isprime(s-2):
yield s
p, q = q, nextprime(q)
CROSSREFS
KEYWORD
nonn
AUTHOR
Altug Alkan, Mar 14 2016
STATUS
approved