A361437 Numbers k such that k! - Sum_{i=1..k-1} (-1)^(k-i)*i! is prime.
2, 3, 4, 5, 6, 7, 8, 12, 15, 58, 59, 102, 111, 118, 164, 291, 589, 685, 1671, 1900, 1945, 4905, 9564
Offset: 1
Examples
2 is in the sequence because 2! + 1! = 3. 3 is in the sequence because 3! + (2! - 1!) = 7. 4 is in the sequence because 4! + (3! - 2! + 1!) = 29. 5 is in the sequence because 5! + (4! - 3! + 2! - 1!) = 139.
Crossrefs
Programs
-
PARI
isok(k) = isprime(k! + sum(i=1, k-1, (-1)^(i+1)*(k-i)!)); \\ Michel Marcus, Mar 12 2023
Extensions
Missing a(10) inserted and a(12)-a(18) from Andrew Howroyd, Mar 12 2023
a(19)-a(22) from Hugo Pfoertner, Mar 13 2023
a(23) from Michael S. Branicky, Oct 02 2024
Comments