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

## Theorem

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

Let:

 $\displaystyle m$ $=$ $\displaystyle \sum_{k \mathop = 0}^{n - 1} \paren {-1}^k \paren {n - k}!$ $\displaystyle$ $=$ $\displaystyle 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 := \displaystyle \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:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

From here on in the numbers become unwieldy.