A306400 For the n-th prime p of the form 6k-1, a(n) is the first prime q for which (p+q^2-1, p+q^2+1) is a twin prime pair.
5, 7, 5, 7, 11, 23, 5, 7, 7, 11, 5, 7, 7, 11, 5, 7, 701, 7, 5, 5, 7, 7, 41, 11, 7, 19, 13, 5, 7, 31, 17, 13, 11, 31, 41, 13, 31, 7, 29, 11, 37, 13, 53, 11, 19, 19, 11, 13, 23, 37, 7, 41, 23, 7, 29, 5, 71, 5, 13, 29, 13, 13, 59, 97, 11, 37, 17, 7, 7, 5, 7, 157
Offset: 1
Examples
Example: for n=5, a(5) = 11, because the 5th prime of the form 6k-1 is 29, and 29+11^2+-1 = (149,151) is a twin prime pair, while 29+2^2+-1, 29+3^2+-1, 29+5^2+-1, 29+7^2+-1 are not twin prime pairs.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
g:= proc(p) local q; q:= 3: do q:= nextprime(q); if isprime(p+q^2-1) and isprime(p+q^2+1) then return q fi; od end proc: map(g, select(isprime, [seq(i,i=5..1000,6)])); # Robert Israel, Nov 23 2020
-
Mathematica
Table[Block[{q = 2}, While[! AllTrue[p + q^2 + {-1, 1}, PrimeQ], q = NextPrime@ q]; q], {p, Select[Range[5, 825, 6], PrimeQ]}] (* Michael De Vlieger, Mar 31 2019 *)
-
PARI
lista(nn) = {forprime(p=2, nn, if (((p+1) % 6) == 0, my(q=5); while (!(isprime(p+q^2-1) && isprime(p+q^2+1)), q = nextprime(q+1)); print1(q, ", ");););} \\ Michel Marcus, Mar 26 2019
Comments