# about prime numbers and patterns

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$.

• Your conjecture is false: $5!-1 = 7 \cdot 17$, $8!-1=23 \cdot 1753$, etc. – Kieren MacMillan Oct 26 '17 at 4:06
• Not to mention that $8!-1=23\times1753$, that $9!=11^2\times2999$, that $10!-1=29\times125131$, and so on. – José Carlos Santos Oct 26 '17 at 4:08
• See <oeis.org/A002982> for a list of $n$ such that $n! - 1$ is prime. – Kieren MacMillan Oct 26 '17 at 4:08
• You are able to guarantee that $n!-1$ is not divisible by any prime less than or equal to $n$, but as mentioned already you cannot make such a claim about primes larger than $n$. – JMoravitz Oct 26 '17 at 4:19
• OK, its seems i have made a mistake. I did 5! -1, and thought that 119 was prime. I then tried some others and looked them up in a list of primes, those were correct. SO i made some mistakes in a particular order that made it seem it was. Thanks for checking the computations. – Palu Oct 26 '17 at 4:41

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$.

• 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 4: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!$. – alex.jordan Oct 26 '17 at 4: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 4:58
• So even if we factored n!-1 into prime factors, none of those would divide into n! either. – Palu Oct 26 '17 at 5: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.

(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.

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.

• Yes, 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 4:59