To find all integers $n > 1$ for which $(n-1)!$ is a zero-divisor in $Z_n$.
To find all integers $n > 1$ for which $(n-1)!$ is a zero-divisor in $\mathbb Z_n$. (Gallian Problem)
$\mathbb Z_n$ does not contain any zero divisors when $n$ is a prime number. So we look at the composite numbers.
For $\mathbb Z_4$ we have $(n-1)!$ as $3! =6$ which is equal to $\bar 2$ and it is a zero divisor.
For $\mathbb Z_6$ we have $(n-1)!$ as $5! =120$ which is equal to $\bar 0$ and it is not a zero divisor.
For $\mathbb Z_8$ we have $(n-1)!$ as $7! =5040$ which is equal to $\bar 0$ and it is not a zero divisor.
We Know if $n$ is composite, then $n$ divides $(n-1)!$ when $n \geq 6$.
Thus the only $n$ for which $(n-1)!$ is a zero-divisor in $\mathbb Z_n$ is $n =4$.
Is the solution correct?
Solution 1:
0 is a zero-divisor. This means that the statement is true for every composite number by a similar argument to yours. (Reply to comment below: I looked it up on Wikipedia. Appearantly different sources use different definitions. Annoying)
If you change the question to involve non-zero zero divisors, your solution is correct.
However, you may be asked to prove "We Know if n is composite, then n divides (n−1)! when n≥6." It is true, but can you prove it?