Ideals of the residual classes $\mathbb Z_n$ Let $n$ be a positive integer and considere the ring $\mathbb Z_n$ of the residual classes modulo $n$. My intuition tells me that there is no two distinct ideals of $\mathbb Z_n$ with the same number of elements. Is this true? 
 A: If $I$ is an ideal of $\mathbb{Z}_n$ whit $d$ elements, then it is generated by $n/d$ i.e $I=(n/d)$, hence the uniqueness. 
A: An ideal of $Z_n$ is the same thing as a subgroup of $Z_n$.  The group $Z_n$ is the set of all $\bar{x}$, where $x \in \mathbb{Z}$.  We have that $\bar{x} = \bar{x'}$ if and only if $x \equiv x' \pmod n$.
Let $H$ be any nontrivial subgroup of $Z_n$.  Let $y \in \mathbb{N}$ be the least positive integer such that $\bar{y} \in H$.  
Lemma: $\bar{y}$ generates $H$.
The subgroup $S$ generated by $\bar{y}$ is the set $k \bar{y}$, where $k$ runs through all the integers.  Already we have $S \subseteq H$, so let $\bar{a} \in H$.  Then, we can divide $a$ by $y$, i.e. we can find integers $q, r$ such that $a = qy + r$ and $0 \leq r \leq y - 1$.  If $r = 0$, then $$a = qy \Rightarrow \bar{a} = q \bar{y}$$ which means $\bar{a} \in S$.  Suppose, however, $1 \leq r \leq n - 1$.  Now $\bar{a} = \overline{qy + r} = q \bar{y} + \bar{r}$, so $\bar{r} = \bar{a} - q \bar{y} \in H$ (because $\bar{a}$ and $q \bar{y}$ are $\in H$).  But this is a contradiction, since we had supposed that $y$ was the smallest positive integer such that $\bar{y} \in H$.  Hence $H \subseteq S$.  $\blacksquare$
Using this lemma you should be able to prove your claim.  
A: The key is the homomorphism theorem: if $f\colon R\to S$ is a surjective ring homomorphism, then $f$ induces a bijection between the set of ideals in $R$ containing $\ker f$ and the set of ideals of $S$. The bijection is simply given by
$$
f^{\to}\colon I \mapsto f^{\to}(I)=\{f(r):r\in I\}
$$
with inverse
$$
f^{\gets}\colon J\mapsto f^{\gets}(J)=\{r\in R:f(r)\in J\}
$$
(Note: $f^{\to}(I)$ and $f^{\gets}(J)$ are most often denoted $f(I)$ and $f^{-1}(J)$, but I find the notation with arrows less confusing.)
Moreover, for $I$ an ideal of $R$ containing $\ker f$ we have $R/I\cong S/f^{\to}(I)$; for $J$ an ideal of $S$, we have $S/J\cong R/f^{\gets}(J)$.
In the case of the canonical homomorphism $\pi\colon\mathbb{Z}\to\mathbb{Z}_n$, we know that $\ker \pi=n\mathbb{Z}$ and we also know all ideals of $\mathbb{Z}$ to be of the form $m\mathbb{Z}$, for a unique $m\ge0$. The ideals of $\mathbb{Z}$ containing $n\mathbb{Z}$ are those of the form $m\mathbb{Z}$ such that $m$ divides $n$.
This said, if $J$ is an ideal in $\mathbb{Z}_n$, we have $J=f^{\to}(m\mathbb{Z})$ and $S/J=\mathbb{Z}/m\mathbb{Z}$ which has exactly $m$ elements and no other quotient of $\mathbb{Z}_n$ can have the same number of elements.
Apply Lagrange's theorem (to the additive group of $\mathbb{Z}_n$) and you're done.
