login
A361437
Numbers k such that k! - Sum_{i=1..k-1} (-1)^(k-i)*i! is prime.
1
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,1
COMMENTS
Numbers k such that k! + A005165(k - 1) is prime.
a(23) > 7000. - Hugo Pfoertner, Mar 15 2023
EXAMPLE
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.
PROG
(PARI) isok(k) = isprime(k! + sum(i=1, k-1, (-1)^(i+1)*(k-i)!)); \\ Michel Marcus, Mar 12 2023
CROSSREFS
Cf. A361436 (the corresponding primes).
Cf. A001272, A005165 (alternating factorials), A071828.
Sequence in context: A238084 A211202 A066418 * A015845 A030702 A305926
KEYWORD
nonn,hard,more
AUTHOR
Jack Braxton, Mar 11 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
STATUS
approved