# Finding an inverse modulo $m$ [closed]

I know that for $m \in \mathbb{Z}$ then $a$ has an inverse modulo $m$ if and only if $\gcd(a,m) = 1$ meaning $a$ and $m$ are relatively prime and their greatest common divisor is 1

Prove that for all integers $n>1$, the number $n-1$ has an inverse modulo $n$. Thank you

## closed as off-topic by Hurkyl, user223391, Ivo Terek, José Carlos Santos, Dando18Oct 5 '17 at 0:02

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Hurkyl, Community, Ivo Terek, José Carlos Santos, Dando18
If this question can be reworded to fit the rules in the help center, please edit the question.

• I feel like I already answered this this morning. – Randall Oct 4 '17 at 1:50
• Hint, $n-1\equiv -1$ modulo $n$. What's a plausible (multiplicative) inverse for $-1$? – Mark Oct 4 '17 at 1:57
• what factors can $n$ and $n-1$ share? – XRBtoTheMOON Oct 4 '17 at 2:09

From the question you wrote, it seems like you already know a potential plan to solve this problem: simply prove $\gcd(n-1, n) = 1$.