# Thread: Algebra, Problems For Fun (13)

1. ## Algebra, Problems For Fun (13)

Definition: An element $a$ in a ring is called an idempotent if $a^2=a.$

Question: Given an integer $n \geq 2,$ how many idempotents are there in $\mathbb{Z}/n\mathbb{Z}$ ?

2. If there is an integer $a$ such that $1 and $n=a^2-a$ then there are 3 idempotents, namely 0, 1 and $a.$ Otherwise 0 and 1 are the only idempotents.

Is that right?

3. Originally Posted by TheAbstractionist
If there is an integer $a$ such that $1 and $n=a^2-a$ then there are 3 idempotents, namely 0, 1 and $a.$ Otherwise 0 and 1 are the only idempotents.

Is that right?
unfortunately it's not right! for example the ring $\mathbb{Z}/6\mathbb{Z}$ has 4 idempotents. i suggest you first solve the problem for $n=p^k,$ where $p$ is a prime.

4. Argh! I was thinking along the line that if $1 is an idempotent then $n=a^2-a.$ It should be $n\mid a^2-a$ rather. Stupid, stupid.

Okay, back to the beginning.

5. Okay, this is actually very simple. I can’t believe I’ve taken such a long time to twig it.

It is clear that $a$ is an idempotent of $\mathbb Z/n\mathbb Z$ if and only if $n$ divides $a^2-a=a(a-1).$ Let $n=p_1^{k_1}p_2^{k_2}\cdots p_r^{k_r}$ where $p_1,p_2,\ldots,p_r$ are the distinct prime factors of $n.$ If $a$ is an idempotent then each prime $p_i$ must divide $a$ or $a-1,$ but not both – otherwise it would divide $a-(a-1)=1.$ So whichever factor it divides, the whole lot $p_i^{k_i}$ will divide that factor. And since each $p_i$ either divides $a$ or $a-1$ (2 choices), it emerges that the number of idempotents $a$ is precisely $2^r.$

Hence the number of idempotents of $\mathbb Z/n\mathbb Z$ where $n\ge2$ is $2^r$ where $r$ is the number of distinct prime factors of $n.$

This is one of the most wonderful problems I’ve ever tried – thank you ever so much, NonCommAlg. It’s a shame I can only thank you once – I would thank you more times if I could.

6. that's correct. you could also use the isomoprhism $\mathbb{Z}/n\mathbb{Z} \cong \bigoplus_{j=1}^r \mathbb{Z}/p_j^{k_j}\mathbb{Z}$ and this simple fact that each $\mathbb{Z}/p_j^{k_j}\mathbb{Z}$ has exactly two idempotents.