<s>[INST] Modular arithmetic $(2n+1)x \equiv -7 \pmod 9$ Find a solution $(2n+1)x \equiv -7 \pmod 9$
I’m sure this is trivial but I still have doubts about it.
I know the equation has solution for certain $n \in \mathbb {Z}$. Actually I have tried a few and got a similar results (with Diophantine equations ). I wonder if there’s general solution for the equation without changing the n for an integer.
Thanks in advance.
 [/INST] \begin{align}
   (2n+1)x &\equiv 2 \pmod 9 \\
   5(2n+1)x &\equiv 1 \pmod 9 \\
   (10n + 5)x &\equiv 1 \pmod 9 \\
   (n-4)x &\equiv 1 \pmod 9 \\
   n-4 &\equiv x^{-1} \pmod 9 \\
   n &\equiv 4 + x^{-1}
\end{align} 
\begin{array}{c}
   x & n \equiv x^{-1} + 4 \\
\hline
   1 & 5 \\
   2 & 0 \\
   3 & \text{No solution.} \\
   4 & 2 \\
   &\text{etc.}
\end{array}
</s>