I have been playing around with numbers such as factorials. I noticed that factorials for $n> 1$, are even numbers and for $n \geqslant 5$, we have that factorials end in at least one zero. Because $2 \cdot 5$ is $10$. So if one defines $t= n! - 1$, I noticed that t seems to be prime based on doing computation of $n= 3$ to $n = 12$. Just wondering if there is a way to show that $n! - 1$ is prime for $n \geqslant 3$.
4 Answers
Since $n!-1$ is relatively prime to $n!$, and $n!$ is divisible by all primes less than or equal to $n$, then none of those primes are going to divide $n!-1$.
But primes larger than $n$ might divide $n!-1$. For example, $7$ divides $5!-1$.

- 54,717
-
Hi Alex, you make a statement that n!-1 is relatively prime to n!. OK so you are saying that since n! is divisible by all numbers less than or equal to n. Then because n! - 1 is greater than n, that means none of the factors of n!-1 would divide into n! How do we know that. How do we know that n!-1 does not contain of of the factors of less than or equal to n. That is , if we prime factored n!-1 into unique prime factors, how would you know that it would not have the numbers less than or equal to n. – Palu Oct 26 '17 at 04:46
-
@Palu No mistake. With any integer $x$, the numbers $x$ and $x-1$ are relatively prime. I'm just applying that to $x=n!$. – 2'5 9'2 Oct 26 '17 at 04:56
-
OK, I think I got you. SO since these two numbers, are consecutive numbers then that means n!-1 won't divide into n!. – Palu Oct 26 '17 at 04:58
-
1So even if we factored n!-1 into prime factors, none of those would divide into n! either. – Palu Oct 26 '17 at 05:01
This is not true, as Kieren points out $5!-1$ is not prime. But your observation is something along the lines of the proof for why there must be an infinite number of primes posed by Euclid.
If there were finitely many primes, $p_1, p_2, \ldots p_n$, then you could consider the number $N=p_1 \cdot p_2 \cdots p_n +1$ and it would be prime since no primes divide it. But $N$ is not in the list of all the primes as it is larger than $p_n$ the largest prime. Thus there must be infinitely many primes.

- 3,860
- 17
- 23
(p-2)!− 1 is always divisible by p for p prime and larger than 2 as a corollary of Wilson's theorem. (p-2)!− 1 = 0 if p = 3, 5 if p = 5, and cannot be prime for p greater than 7 since (p-2)!− 1 will be greater than and divisible by p.

- 2,061
You saw that it was true for $n=3$. You saw that it was true for $n=12$. Why did you think that was enough to assume it was true for all $n \geq 3$? You didn't even check between $3$ and $12$ ...
As others have pointed out, it fails for $n=5$, since $5!-1$ isn't prime:
$$5!-1 = 120 - 1 = 119 = 7 \cdot 17 $$
Even if you had checked all the way up to $12$, you should be careful with patterns like this. See this list of patterns that start off looking promising but eventually fail.

- 67
-
1Yes, I made a major fail when I went thru most of the numbers, I admit that. I thank the people that have redone the calculation. – Palu Oct 26 '17 at 04:59
sequence oeis.org/A002982 is infinite?
– Widawensen Oct 26 '17 at 09:18