OFFSET
1,1
COMMENTS
Even if there are infinitely many twin primes, it is not clear that this sequence is infinite. The Hardy-Littlewood conjecture implies that there are infinitely many twin primes where p+2 is not in the sequence. - Robert Israel, Apr 02 2014
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
(11*13)^2 > (5*7)*(17*19): (11*13)^2 > (3*5)*(29*31).
MAPLE
N:= 20000:
Primes:= [seq(ithprime(i), i=1..N)]:
Twink:= select(t-> (Primes[t+1]=Primes[t]+2), [$1..N-1]):
Qk:= [seq(Primes[i]*Primes[i+1], i=Twink)]:
filter:= proc(k)
local T, i;
T:= Qk[k]^2;
for i from 1 to k-1 do
if Qk[k-i]*Qk[k+i]>=T then return false fi
od;
true
end;
R:= select(filter, [$1 .. floor(nops(Twink)/2)]):
A021007:= map(k -> Primes[Twink[k]+1], R); # Robert Israel, Apr 02 2014
PROG
(PARI) twins=List(); p=3; forprime(q=5, 1e5, if(q-p==2, listput(twins, q)); p=q); for(k=1, (#twins+1)\2, for(i=1, k-1, if(twins[k]^2 < twins[k-i]*twins[k+i], next(2))); print1(twins[k]", ")) \\ Charles R Greathouse IV, Apr 02 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
a(1) inserted by Robert Israel, Apr 02 2014
STATUS
approved