# Criteria for the existence of zero-divisors and idempotent elements in the integers modulo $n$

I need help in establishing or at least deciding the validity of the following two criteria:

• There are in the ring $Z_n$ non-trivial zero divisors if only if $n$ is divisible with some square.
• There are in the ring $Z_n$ non-trivial idempotent elements if only if $n$ divides the product of two consecutive integers.
• What are you asking? As mentioned in an answer, a) is false. b) is right. What do you want to know specifically? – quid Jan 25 '15 at 13:54
• @quid But every integer divides the product of two consecutive integers, so b) doesn't seem correct either. – rschwieb Jan 25 '15 at 15:41
• @rschwieb yes I realized this now too while typing up my answer where it is adressed.// Generally I now realized too what the issue with first one should be. It ought to be nilpotent not zero-divisor. – quid Jan 25 '15 at 15:53

There is possibly some confusion regarding the terms used in the first criterion, let me try to clear this up.

1. It is false that non-trivial zero-divisors exists only if $n$ is divisible by a square. Recall that that a nontrivial zero-divisor is a nonzero (modulo $n$) element $a$ such that $ab \equiv 0$ for a non-zero $b$. If $n$ is not a prime number, and $d \mid n$ is a divisor other than $1$ and $n$, then $$d \ \frac{n}{d} \equiv 0 \pmod{n}$$ so $d$ is a non-trivial zero-divisor. It is also possible to show that if $n$ is prime then there are no non-trivial zero-divisors; just recall that $n \mid ab$ implies that $n \mid a$ or $n \mid b$ if $n$ is prime. So the criterion is (the special case $n= 1$ is easy):

$\mathbb{Z}_n$ contains nontrivial zero-divisors if and only if $n$ is composite.

The criterion you gave is a criterion for something else though. Namely, an element $a$ is called nilpotent if $a^k \equiv 0 \mod n$ for some positive integer $k$. One has the following criterion:

$\mathbb{Z}_n$ contains nontrivial nilpotent elements if and only if $n$ is divisible by a square.

To see this note that if $m^2 \mid n$ then $(\frac{n}{m})^2 = n \frac{n}{m^2} \equiv 0 \mod n$. And, conversely if $n$ is squarefree, then for $1 \le a \le n-1$ there is a prime $p \mid n$ such that $p \nmid a$ and then $p \nmid a^k$ for each $k$ showing that $a^k$ is non-zero modulo $n$.

2. An element $a$ is called idempotent if $a^2 \equiv a \mod n$. This is equivalent to $a^2 - a \equiv 0 \mod n$ so $n \mid (a^2 -a) = a(a-1)$. Showing the validity of the criterion:

$\mathbb{Z}_n$ contains a nontrivial idempotent element if and only if $n$ divides the product of two consecutive positive integers less than $n$.

If one does not insist on the integers being positive (or at least non-zero) the condition is empty as $n$ always divides $0 = 0 \times 1$ as well as e.g. $n\times(n-1)$.

• 2. it's not a criterion, it's just a reformulation of the definition. If you really want to say something less trivial, then this is the following: $\mathbb Z_n$ contains a nontrivial idempotent iff $n$ is divisible by at least two different primes. – user26857 Jan 25 '15 at 16:28
• This is certainly more interesting, however, it is not what was asked. (But I admit I had not thought of it either, else I might have mentioned it. So thanks for bringing it up.) – quid Jan 25 '15 at 16:35
• You are welcome. For the future perhaps try to ask questions containing more of your own thoughts on the problem. In this case it took me quite a while to figure out what was going on. Had you provided more information the process might have been quicker. – quid Jan 25 '15 at 19:57

In $\mathbf{Z}_6$ there are non-trivial zero divisors, but $6$ is squarefree. [?]