# Thread: Algebra, Problems For Fun (13)

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

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

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

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

Is that right?

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

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

4. Argh! I was thinking along the line that if $\displaystyle 1<a<n$ is an idempotent then $\displaystyle n=a^2-a.$ It should be $\displaystyle 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 $\displaystyle a$ is an idempotent of $\displaystyle \mathbb Z/n\mathbb Z$ if and only if $\displaystyle n$ divides $\displaystyle a^2-a=a(a-1).$ Let $\displaystyle n=p_1^{k_1}p_2^{k_2}\cdots p_r^{k_r}$ where $\displaystyle p_1,p_2,\ldots,p_r$ are the distinct prime factors of $\displaystyle n.$ If $\displaystyle a$ is an idempotent then each prime $\displaystyle p_i$ must divide $\displaystyle a$ or $\displaystyle a-1,$ but not both – otherwise it would divide $\displaystyle a-(a-1)=1.$ So whichever factor it divides, the whole lot $\displaystyle p_i^{k_i}$ will divide that factor. And since each $\displaystyle p_i$ either divides $\displaystyle a$ or $\displaystyle a-1$ (2 choices), it emerges that the number of idempotents $\displaystyle a$ is precisely $\displaystyle 2^r.$

Hence the number of idempotents of $\displaystyle \mathbb Z/n\mathbb Z$ where $\displaystyle n\ge2$ is $\displaystyle 2^r$ where $\displaystyle r$ is the number of distinct prime factors of $\displaystyle 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 $\displaystyle \mathbb{Z}/n\mathbb{Z} \cong \bigoplus_{j=1}^r \mathbb{Z}/p_j^{k_j}\mathbb{Z}$ and this simple fact that each $\displaystyle \mathbb{Z}/p_j^{k_j}\mathbb{Z}$ has exactly two idempotents.