NBHM 2020 PART B Question 21 Solution (Number of ideals, units, nilpotents and idempotent elements in $\Bbb Z_n$).

Let $R:=\frac{\Bbb Z}{2020 \Bbb Z}$ be the quotient ring of the integers $\Bbb Z$ by the ideal $2020 \Bbb Z$.
(a) What is the number of ideals in $R$?,
(b) What is the number of units in $R$?
(c) What is the number of elements $r \in R$ such that $r^n=1$ for some integer $n \ge 1$?
(d) What is the number of elements $r \in R$ such that $r^n=0$ for some integer $n \ge 1$?
Solution:
Observation: Let $R$ be either $\Bbb Z$ or $\Bbb Z_n$, then $I$ is an ideal in $R$ if and only if $I$ is just an additive subgroup of $R$.
The necessary part is straight forward. We prove the sufficient part. We prove that every additive subgroup of $R$ is an ideal of $R$. Let  $(I,+)$ be an additive subgroup of $R$. Let $r \in R$ and $a \in I$, we claim that $ra \in I$ which will prove that $I$ is an ideal. Note that $r \in R$ and every element of $R$ is an integer. Hence $ra = \underbrace{a+a+\cdots+a}_{r \,times}$ if $r\ge 0$ and $ra = \underbrace{(-a)+(-a)+\cdots+(-a)}_{r \,times}$ if $r<0$. Since $I$ is an additive group, by the closure property, we have $ra \in I$. This proves that $I$ is an ideal.
option a: By the above observation, to count the number of ideals in $\frac{\Bbb Z}{2020 \Bbb Z}$, it is enough to count the number of subgroups in $\frac{\Bbb Z}{2020 \Bbb Z}$. We know that in $\frac{\Bbb Z}{n\Bbb Z}$ there is a unique subgroup for each divisor of $n$. Hence the number of subgroups is equal to $d(n) = \text{number of divisors of }n$. So we will calculate the number of divisors of $2020 = 2^2 \times 5^1 \times 101^1$. Now, the number of divisors $=(2+1)(1+1)(1+1) = 12.$
option b: (Number of Units) Claim: $a \in \Bbb Z_n$ is a unit if and only if $(a,n) =1$. Proof:Suppose $(a,n)=1$, then there exists $x,y$ such that $ax+ny=1$, now reducing this modulo $n$ we get $ax=1$ and $x$ is the required inverse. Conversely suppose $a$ is a unit, then $ax =1$ in $\Bbb Z_n$. That is $ax \equiv 1 mod(n)$. Hence, $ax = yn + 1$ for some integer $y$ and $ax-yn=1$. This shows that, by the Euclidean algorithm, $(a,n)=1$.
This shows that the number of units in $\frac{\Bbb Z}{2020\Bbb Z}$ is equal to the cardinality of the set $\{1\le i\le 2020:(i,n)=1\}$ which is counted by the Euler totient function $\phi(2020) = 2020(1-\frac{1}{2})(1-\frac{1}{5})(1-\frac{1}{101}) = 800$.
option c: Let $U_n$ be the set of units in $\frac{\Bbb Z}{n\Bbb Z}$. We claim that $W_n:=\{a \in \frac{\Bbb Z}{n\Bbb Z}: a^k = 1 \text{ for some$k \ge 1$}\} = U_n$. Let $a \in W_n$, then $a^k = 1$ for some $k \ge 1$. This implies that $a \times a^{k-1}=1$ and hence $a$ is a unit. Conversly suppose $a \in U_n$. We observe that $U_n$ is a finite group under multiplication. In particular, every element of $U_n$ is of finite order. This shows that, there exists $k\ge 1$ such that $a^k=1$ and $a \in W_n$.
Hence the required answer $|W_{2020}| = |U_{2000}| = \phi(2020) = 800$.
option d: (number of nilpotents) Consider $R = \frac{\Bbb Z}{n \Bbb Z}$ where $n = p_1^{k_1}p_2^{k_1}\cdots p_m^{k_m}$. We observe that, the primes $p_1,p_2,\dots p_m$ occur as prime factors of all the multiples of $n$. Let $a \in R$ such that not all prime divisor of $n$ occur in the prime factorization of $a$, then $a^n$ can never be a multiple of $n$. So $a^n$ is not nilpotent. This shows that, if $a$ is nilpotent, then all the primes $p_1,p_2,\dots,p_m$ should be prime divisors of $a$. Now consider $b = p_1p_2\cdots p_m \in R$ and $k = max\{k_1,k_2,\dots,k_m\}$, then $b^k$ is a multiple of $n$ and hence nilpotent. Similarly, let $xb$ be a multiple of $b$ in $R$, then $(xb)^k = x^kb^k = 0$. So every multiple of $b$ in $R$ is nilpotent in $R$. We shall count them. Let <b> = $\{xb: x \in R\}$ this is the subgroup generated by $b$ whose cardinality is equal to the order of $b$. Now, order of $b$ is equal to $\frac{n}{(b,n)} = \frac{n}{b}$. Thus, the number of nilpotent elements in $\frac{\Bbb Z}{\Bbb nZ}$ is equal to $\frac{n}{p_1p_2\cdots p_m}$. In particular, for $\frac{\Bbb Z}{2020 \Bbb Z}$ it is equal to $\frac{2020}{2 \times 5 \times 1010} = 2$.
Bonus: (Number of idempotents in $\Bbb Z_n$).
Let $n = p_1^{k_1} p_2^{k_2}\cdots p_m^{k_m}$ be the prime factorization of $n$, then $$\Bbb Z_n \cong \prod_{i=1}^m \Bbb Z_{p_i^{k_i}}.$$ This isomorphism (say $\phi$) is given by $k$ goes to $(k \,mod(p_1^{k_1}), k \,mod(p_2^{k_2}),\dots, k \,mod(p_m^{k_m}))$.
Claim: $k$ is idempotent in $\Bbb Z_n$ if and only if, $k\,mod(p_i^{k_i})$ is idempotent in $\Bbb Z_{p_i^{k_i}}$ for each $1 \le i \le m$. Proof: Suppose $k$ is idempotent in $\Bbb Z_n$ then $a^2 - a = 0$, apply the ring isomorphism $\phi$ we get $\phi(a^2-a) = (a^2-a mod(p_1^{k_1}),\cdots a^2-a mod(p_m^{k_m})) = (0,0,\dots,0)$. This implies that $a^2 - a \equiv 0 \,mod(p_i^{k_i})$ for all $1 \le i \le m$. This shows that $a \, mod(p_i^{k_i}) \in \Bbb Z_{p_i^{k_i}}$ is idempotent for $1 \le i \le m$. Now, converse follows from Chinese reminder theorem.
In view of this claim, it is enough to understand the idempotents in $\Bbb Z_{p^m}$. We claim that $0$ and $1$ are the only idempotents of $\Bbb Z_{p^m}$. Let $a$ be an idempotent in $\Bbb Z_{p^m}$, then $a^2 - a \equiv 0 \,mod(p^m)$. That is $p^m | a(a-1)$. Since $a$ and $a-1$ are relatively prime $p$ cannot divide both $a$ and $a-1$ and hence for $p^m$ to divide $a(a-1)$ it should divide one of $a$ or $(a-1)$ (whichever $p$ divides). Now $p^m | a$ implies $a=1$ and $p^m$ divides $a-1$ implies $a=1$. This proves the claim.
We have proved that $a$ is idempotent if and only if each coordinate of $(a \,mod(p_1^{k_1}), a \,mod(p_2)^{k_2},\dots, a \,mod(p_m^{k_m}))$ is idempotent in $\Bbb Z_{p_i^{k_i}}$ for $1 \le i \le m$. But the only choice for idempotents in $\Bbb Z_{p_i}^{k_i}$ are $0$ and $1$. Hence the idempotents in $\Bbb Z_n$ are $\{(a_1,a_2,\dots,a_m): a_i \text{ are either$0$or$1$} \}$ and this set has cardinallity $2^{m} = 2^{\text{number of prime factors of$n$}}$.
NBHM 2020 PART A Question 4 Solution $$\int_{-\infty}^{\infty}(1+2x^4)e^{-x^2} dx$$
Evaluate : $$\int_{-\infty}^{\infty}(1+2x^4)e^{-x^2} dx$$ Solution : \int_{-\infty}^{\infty}(1+2x^4)e^{-x^2} dx = \int_{-\infty}^{\inft...