0

What is $a^{-1}\pmod a$?

From what I've tried it came out to be zero because

$a^{-1} = a * a^{-2}$

$a^{-1} \pmod a = a * a^{-2} \pmod a$

$a * a^{-2}$ is divided by $a$ so the result should be zero.

Is my proof right?

More Code
  • 221

1 Answers1

2

Unless $a = 1$, $a$ doesn't ever have an inverse $\pmod a$: For if it did, there would exist a $b$ such that $ab \equiv 1 \pmod{a}$. But this leads to

$$1 \equiv ab \equiv 0 \pmod{a}$$

This implies that $a | 1$.