login
Numbers k such that 6*k - 1 is a prime that can be written as p*q - 2, with p and q being consecutive primes.
2

%I #20 Sep 05 2021 11:27:35

%S 4265,7842,11265,22815,52265,160065,167662,322003,383542,393722,

%T 1016815,1051677,1150182,1290842,1372803,1555498,1826015,2184065,

%U 2808498,3168265,3200307,3231062,3333117,3427680,3676962,3913915,4042598,4323102,4537907,4623542,4798955

%N Numbers k such that 6*k - 1 is a prime that can be written as p*q - 2, with p and q being consecutive primes.

%F a(n) = (A123921(n+1) + 1)/6, excluding A123921(1).

%e a(1) = 4265, because the prime 25589 = 6*4265 - 1 can be written as 157*163 - 2, with 157 and 163 being consecutive primes.

%o (PARI) a342565(plim)={my(p1=5);forprime(p2=7,plim,my(p=p1*p2-2);if(isprime(p),print1((p+1)/6,", "));p1=p2)};

%o a342565(5400)

%o (Python)

%o from primesieve.numpy import n_primes

%o from numbthy import isprime

%o primesarray = numpy.array(n_primes(10000, 1))

%o for i in range (0, 9999):

%o totest = int(primesarray[i] * primesarray[i+1] - 2)

%o if (isprime(totest)) and (((totest+1)%6) == 0):

%o print((totest+1)//6) # _Karl-Heinz Hofmann_, Jun 20 2021

%Y Cf. A123921, whose first term 13 = 3*5 - 2 cannot be written as 6*k - 1.

%Y Cf. A048880, A342564.

%K nonn,easy

%O 1,1

%A _Hugo Pfoertner_, Jun 20 2021