# Sum of Sequence of Alternating Positive and Negative Factorials being Prime

## Theorem

Let $n \in \Z_{\ge 0}$ be a positive integer.

Let:

 $\ds m$ $=$ $\ds \sum_{k \mathop = 0}^{n - 1} \paren {-1}^k \paren {n - k}!$ $\ds$ $=$ $\ds n! - \paren {n - 1}! + \paren {n - 2}! - \paren {n - 3}! + \cdots \pm 1$

The sequence of $n$ such that $m$ is prime begins:

$3, 4, 5, 6, 7, 8, 10, 15, 19, 41, 59, 61, 105, 160, \ldots$

The sequence of those values of $m$ begins:

$5, 19, 101, 619, 4421, 35 \, 899, 3 \, 301 \, 819, 1 \, 226 \, 280 \, 710 \, 981, \ldots$

## Proof

Let $\map f n$ be defined as:

$\map f n := \ds \sum_{k \mathop = 0}^{n - 1} \paren {-1}^k \paren {n - k}!$

First we observe that for $n > 1$:

$\map f n := n! - \map f {n - 1}$

We have:

 $\ds \map f 1$ $=$ $\ds 1!$ $\ds$ $=$ $\ds 1$ which is not prime

 $\ds \map f 2$ $=$ $\ds 2! - \map f 1$ $\ds$ $=$ $\ds 2 - 1$ Examples of Factorials $\ds$ $=$ $\ds 1$ which is not prime

 $\ds \map f 3$ $=$ $\ds 3! - \map f 2$ $\ds$ $=$ $\ds 6 - 1$ Examples of Factorials $\ds$ $=$ $\ds 5$ which is prime

 $\ds \map f 4$ $=$ $\ds 4! - \map f 3$ $\ds$ $=$ $\ds 24 - 5$ Examples of Factorials $\ds$ $=$ $\ds 19$ which is prime

 $\ds \map f 5$ $=$ $\ds 5! - \map f 4$ $\ds$ $=$ $\ds 120 - 19$ Examples of Factorials $\ds$ $=$ $\ds 101$ which is prime

 $\ds \map f 6$ $=$ $\ds 6! - \map f 5$ $\ds$ $=$ $\ds 720 - 101$ Examples of Factorials $\ds$ $=$ $\ds 619$ which is prime

 $\ds \map f 7$ $=$ $\ds 7! - \map f 6$ $\ds$ $=$ $\ds 5040 - 619$ Examples of Factorials $\ds$ $=$ $\ds 4421$ which is prime

 $\ds \map f 8$ $=$ $\ds 8! - \map f 7$ $\ds$ $=$ $\ds 40 \, 320 - 421$ Examples of Factorials $\ds$ $=$ $\ds 35 \, 899$ which is prime

 $\ds \map f 9$ $=$ $\ds 9! - \map f 8$ $\ds$ $=$ $\ds 362 \, 880 - 35 \, 899$ Examples of Factorials $\ds$ $=$ $\ds 326 \, 981 = 79 \times 4139$ which is not prime

 $\ds \map f {10}$ $=$ $\ds 10! - \map f 9$ $\ds$ $=$ $\ds 3 \, 628 \, 800 - 326 \, 981$ Examples of Factorials $\ds$ $=$ $\ds 3 \, 301 \, 819$ which is prime

 $\ds \map f {11}$ $=$ $\ds 11! - \map f {10}$ $\ds$ $=$ $\ds 39 \, 916 \, 800 - 3 \, 301 \, 819$ Factorial of $11$ $\ds$ $=$ $\ds 36 \, 614 \, 981 = 13 \times 2 \, 816 \, 537$ which is not prime

 $\ds \map f {12}$ $=$ $\ds 12! - \map f {11}$ $\ds$ $=$ $\ds 479 \, 001 \, 600 - 36 \, 614 \, 981$ Factorial of $12$ $\ds$ $=$ $\ds 442 \, 386 \, 619 = 29 \times 15 \, 254 \, 711$ which is not prime

 $\ds \map f {13}$ $=$ $\ds 13! - \map f {12}$ $\ds$ $=$ $\ds 6 \, 227 \, 020 \, 800 - 36 \, 614 \, 981$ Factorial of $13$ $\ds$ $=$ $\ds 5 \, 784 \, 634 \, 181 = 47 \times 1427 \times 86 \, 249$ which is not prime

 $\ds \map f {14}$ $=$ $\ds 14! - \map f {13}$ $\ds$ $=$ $\ds 87 \, 178 \, 291 \, 200 - 5 \, 784 \, 634 \, 181$ Factorial of $14$ $\ds$ $=$ $\ds 81 \, 393 \, 657 \, 019 = 23 \times 73 \times 211 \times 229 \, 751$ which is not prime

 $\ds \map f {15}$ $=$ $\ds 15! - \map f {14}$ $\ds$ $=$ $\ds 1 \, 307 \, 674 \, 368 \, 000 - 81 \, 393 \, 657 \, 019$ Factorial of $15$ $\ds$ $=$ $\ds 1 \, 226 \, 280 \, 710 \, 981$ which is prime

From here on in the numbers become unwieldy.