# Find $n\in \mathbb N$ so that $(\mathbb Z_n, +, \cdot)$ has exactly 4 invertible elements and 5 zero-divisors

Find $n\in \mathbb N$ so that $(\mathbb Z_n, +, \cdot)$ has exactly 4 invertible elements and 5 zero-divisors.

As I couldn't find any theorem that would lead me toward a solution, so I have been trying guessing and checking with no results so far, so I am asking for a push in the right direction.

-
Is it exactly 4 invertible elements and exactly 5 zero-divisors? – lhf Sep 1 '12 at 17:11
@lhf yep! I am sure. – haunted85 Sep 1 '12 at 22:05
In this case, $n$ would have to be 9 but $\mathbb Z_9$ has 6 units. – lhf Sep 2 '12 at 1:07
Also, $\phi(n)=4$ iff $n=5, 8, 10, 12$. – lhf Sep 2 '12 at 1:10
Perhaps we are using a definition whereby zero is not a zero-divisor. – Gerry Myerson Sep 2 '12 at 6:34

HINT: $x$ is a unit in $\mathbb{Z}_n$ if and only if gcd$(n,x) = 1$
EDIT: furthermore: Let $R$ be a finite ring with unity, and $x \in R$: $x$ is a unit in $R$ if and only if $x$ is no zero divisor and $x \neq 0$