Let $R$ be a ring. An element $x$ in $R$ is said to be idempotent if $x^2=x$. For a specif $n\in{\bf Z}_+$, which is not very large, say, $n=20$, one can calculate one by one to find that there are four idempotent elements: x=0,1,5,16. So here is my question:
Is there a general result which tells the number of the idempotent elements of ${\bf Z}_n$?