login
A309789
Numbers n such that -1 + Sum_{k=1..n} prime(k)! is prime, where prime(k) is the k-th prime.
0
2, 3, 4, 20, 25
OFFSET
1,1
COMMENTS
The sequence is finite. Proof: for n=112, the sum is 2! + 3! + 5! + ... + 601! + 607! - 1, which is divisible by the next prime, 613. All the factorials of the subsequent primes 613!, 617!, ... are obviously divisible by 613. So after n=112 the sum will always be divisible by 613. And from n=26 to n=112 there are no other primes. So this sequence will not produce any other primes. - Metin Sariyar, Aug 26 2019
EXAMPLE
4 is a term because 2, 3, 5, 7 are the first 4 primes and 2! + 3! + 5! + 7! - 1 = 5167 is prime.
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 *)
PROG
(PARI) isok(n) = isprime(sum(k=1, n, prime(k)!) - 1); \\ Michel Marcus, Aug 18 2019
CROSSREFS
KEYWORD
nonn,fini,full
AUTHOR
Metin Sariyar, Aug 17 2019
STATUS
approved