# Modulo exponentiation invertibility [duplicate]

Under which condition is $f : x \mapsto x^e \mod n$ invertible?

I mean, for each distinct $x \in \{0, 1, 2, \ldots, n-1\}$ the result is distinct?

Is that $e$ must be coprime with the totient of $n$ ($\varphi(n)$)?

I read several articles on RSA, but this point is still not clear to me.

## marked as duplicate by Biv, kodlu, e-sushiAug 16 '17 at 2:37

• @SEJPM I think it is: "When is the map $\mathbb Z/n\to\mathbb Z/n$ given by $x\mapsto x^e$ a bijection?" – yyyyyyy Aug 15 '17 at 18:59
• I disagree this is an exact duplicate. In particular, the condition thought is NOT that $e$ must be coprime with the totient of $n$. We also need that $n$ is squarefree. – fgrieu Aug 16 '17 at 13:47