OFFSET
1,1
LINKS
Dmitry Petukhov, Table of n, a(n) for n = 1..40
FORMULA
a(n) = p(i) if ( (p(i+1) = p(i)+2) AND (min(p(i+2)-p(i+1), p(i)-p(i-1)) > a(n-1)) ), where a(0) = 0, p(k) = prime(k) = A000040(k).
EXAMPLE
(3,5) is a twin primes pair, min(7-5, 3-2)=1, therefore a(1)=3.
(5,7) is a twin primes pair, min(11-7, 5-3)=2>1, therefore a(2)=5.
(11,13) is a twin primes pair, min(17-13, 11-7)=4>2, therefore a(3)=11.
PROG
(PARI) {m=0; q=5; s=3; t=2; forprime(p=6, 10^9, if((q-s==2) && (min(p-q, s-t)>m), m=min(p-q, s-t); print1(s, ", ") ); t=s; s=q; q=p; )}
CROSSREFS
KEYWORD
nonn
AUTHOR
Dmitry Petukhov, Oct 04 2015
STATUS
approved