cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A139602 The smallest prime p that makes the pair p+/-6n both primes while no other pair of p+/-6k+6*n, 0

Original entry on oeis.org

11, 19, 61, 43, 97, 163, 191, 229, 283, 223, 743, 991, 541, 457, 877, 1327, 1049, 1321, 1733, 1307, 1987, 6011, 2971, 5153, 2029, 8693, 2551, 4789, 5407, 2129, 6473, 4481, 4889, 4217, 7951, 11743, 13789, 9851, 7253, 11491, 20393, 17231, 9749, 20747, 6599, 13873, 16369, 15461, 17123, 13451, 9967, 26959, 21089, 41863, 27437, 26003, 40189, 18661, 16673, 64693
Offset: 1

Views

Author

Lei Zhou, Mar 22 2011

Keywords

Comments

Dickson's conjecture implies that this sequence is infinite. - Charles R Greathouse IV, Mar 22 2011
2a(n) = (p-6n) + (p+6n).

Examples

			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.
		

Programs

  • 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}]
  • 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