For which $n > 1$, the set of all not invertible elements of the ring $\mathbb{Z}_n$ is an ideal?
This is where I got to:
The ideal, surely, should consists only of zero- divisors (because each not invertible element is a zero- divisor). Also, all zero- divisors in $\mathbb{Z}_n$ are the elements which are NOT coprime with $n$.
For example, in $\mathbb{Z}_6 = \{ \bar{0}, \bar{1},\bar{2},\bar{3},\bar{4},\bar{5}\}$, all zero-divisors are $\bar{0}, \bar{2},\bar{3},\bar{4}$, but obviously that's NOT an ideal. So, I get stuck on what should be those $n$, for which in $\mathbb{Z}_n$ all zero- divisors (not inversible elements) are an ideal ?