A309789 Numbers n such that -1 + Sum_{k=1..n} prime(k)! is prime, where prime(k) is the k-th prime.
2, 3, 4, 20, 25
Offset: 1
Examples
4 is a term because 2, 3, 5, 7 are the first 4 primes and 2! + 3! + 5! + 7! - 1 = 5167 is prime.
Programs
-
Mathematica
p=-1; lst={}; Do[p+=Prime[n]!; If[PrimeQ[p], AppendTo[lst, n]], {n, 1000}]; lst Position[Accumulate[Prime[Range[25]]!],?(PrimeQ[#-1]&)]//Flatten (* _Harvey P. Dale, May 03 2021 *)
-
PARI
isok(n) = isprime(sum(k=1, n, prime(k)!) - 1); \\ Michel Marcus, Aug 18 2019
Comments