For what prime numbers $p$ there exists a ring with identity and exactly $p$ invertible elements ? 


**REMARK** It can be shown that for $p=5$ there is no such ring, so I am wondering for what values of $p$ such a ring exists.



Rings with group of units cyclic of prime order
For $p=2$, $\mathbb F\_3$ is an example.


Otherwise, $p$ is odd, so $-1$ is a unit of order $2$ unless it is equal to $1$, so $1=-1$, so $2=0$. We can form the ring:


$\mathbb Z[x]/(2,x^p-1)= \mathbb F\_2[x]/(x^p-1)$. Any ring with exactly $p$ invertible elements admits a map from this universal ring whose image is the subring generated by the invertible elements, which must also have exactly $p$ invertible elements, so if there is any example, one example is quotient of this ring.


This ring is a product of finite fields of characteristic $2$, since $x^p-1$ has distinct roots over $\mathbb F\_2$. So any quotient must be a product of finite fields of characteristic $2$. Since the unit group of a product is the product of the unit group, and the unit group, being cyclic, does not decompose as a product, it must be the unit group of a single field of characteristic $2$.


So if $p\neq 2$, it must be of the form $2^n-1$ - a Mersenne prime.


