OFFSET
2,2
COMMENTS
Theorem: a(n) takes only the values 0, 3, 5, 7, 9, 11, 13, 15, and 17.
LINKS
Peter J. C. Moses, Table of n, a(n) for n = 2..5001
Vladimir Shevelev, "Nearest" twin primes, Post to seqfan, Sep 21 2016.
Vladimir Shevelev, Peter J. C. Moses, Constellations of primes generated by twin primes, arXiv:1610.03385 [math.NT], 2016.
FORMULA
a(n) = 3 on a subsequence of measure 1. - Charles R Greathouse IV, Oct 17 2016
PROG
(PARI) nextcomposite(n)=if(n<4, return(4)); n=ceil(n); if(isprime(n), n+1, n)
do(p)=my(a=p, b=p+2, f); for(n=3, 17, f=if(isprime(n), nextprime, nextcomposite); a=f(a+1); b=f(b+1); if(b-a > 6, return(n))); 0
p=2; forprime(q=3, 1e3, if(q-p==2, print1(do(p)", ")); p=q) \\ Charles R Greathouse IV, Oct 17 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev and Peter J. C. Moses, Sep 30 2016
STATUS
approved