# Does Fermat's Little Theorem imply $n^{p-2} \equiv \frac{p+1}{n}$ (mod $p$)?

Fermat's Little Theorem tells us for a prime $p$ if $\gcd(p,n)=1$, then:

$$n^{p-1} \equiv 1 \pmod p$$

If $n | (p+1)$, does it necessarily follow that:

$$n^{p-2} \equiv \frac{p+1}{n} \pmod p$$

$$n^{p-1}\equiv 1 \equiv p+1 \pmod p \implies n^{-1}n^{p-1}\equiv n^{-1}(p+1)\pmod p \iff n^{p-2}\equiv \frac {p+1}n$$