OFFSET
1,1
COMMENTS
Dickson's conjecture implies that this sequence is infinite. - Charles R Greathouse IV, Mar 22 2011
2a(n) = (p-6n) + (p+6n).
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..1000
EXAMPLE
For n = 1, 11-6n=5, 11+6n=17, are both primes, and for any prime number p smaller than 11, it is impossible that p-6 is prime;
For n = 2, 19-6n=7, 19+6n=31, are both primes,while 19+6*1=25 is not prime. For primes p<19, either p+/-6 are prime pairs, or p+/-12 are not a prime pair;
...
for n = 6, 163-6n=127, 163+6n=199, are both primes,while 163+6*k, k=1,2,4 and 163-6*k, k=3,5 are not primes. For primes p<163, either exists prime pair p+/-6k, 0<k<6, or p+/-36 are not a prime pair.
MATHEMATICA
BothPrime[p_, k_] := PrimeQ[p + 6*k] && PrimeQ[p - 6*k]; f[n_] := Module[{p, k}, p = Prime[PrimePi[6*n] + 1]; While[k = 1; While[k < n && ! BothPrime[p, k], k++]; k < n || ! BothPrime[p, n], p = NextPrime[p]]; p]; Table[f[n], {n, 60}]
PROG
(PARI) a(n)=forprime(p=2, default(primelimit), if(!isprime(p-6*n) || !isprime(p+6*n), next); for(k=1, n-1, if(isprime(p-6*k) && isprime(p+6*k), next(2))); return(p)) \\ Charles R Greathouse IV, Mar 22 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
Lei Zhou, Mar 22 2011
STATUS
approved