A128659 Numbers k such that p(k+1)# - p(k)# - p(k-1)# - 1 is prime, where p(i)# = product of first i primes = A002110(i).
1, 3, 4, 5, 6, 7, 9, 13, 14, 20, 30, 40, 44, 86, 101, 135, 152, 171, 205, 4404, 12227
Offset: 1
Examples
1 is a term since A002110(2) - A002110(1) - A002110(0) - 1 = 6 - 2 - 1 - 1 = 2.
Programs
-
Mathematica
{1}~Join~Flatten[Position[Partition[Rest[FoldList[Times,1,Prime[Range[210]]]],3,1],?(PrimeQ[#[[3]]-#[[2]]-#[[1]]-1]&),{1},Heads->False]]+1 (* This generates the first 18 terms of the sequence. To generate the 19th term, change the Range constant to 4410, but it will take a very long time to run. *) (* _Harvey P. Dale, Apr 23 2014 *)
-
PARI
isok(k) = ispseudoprime(vecprod(primes(k+1)) - vecprod(primes(k)) - vecprod(primes(k-1)) - 1); \\ Michel Marcus, May 07 2025
Extensions
a(1) = 1 inserted by Michael S. Branicky, May 07 2025
a(21) from Michael S. Branicky, May 10 2025