Modular arithmetic $(3n - 2)x + 5n \equiv 0 \pmod{9n-9}$ $(3n - 2)x + 5n \equiv 0 \pmod{9n-9}$
I know that the congruence has a solution if $gcd((3n - 2), (9n -9)) \mid -5n$ And it seems to have solution because $gcd((3n - 2), (9n -9)) = 1$
I tried with several $x$’s in the equation $(3n-2)x +5n$ but couldn’t found one that would be divisible by $(9n -9)$
I’m lost. Before, I posted a similar problem Modular arithmetic $(2n+1)x \equiv -7 \pmod 9$
The similarity I see is that in the module the number $9$ Appears again. Still I don’t know if it’s useful.
Thanks in advance.  
 A: $\begin{align} {\bf Hint}\ \bmod 9(n\!-\!1)\!:\ \, &3n\!-\!2\:\! =\:\! \overbrace{ 1\,+\,\color{#0a0}\epsilon}^{\large 1\ +\ \color{#0a0}{3(n-1)}\!\!\!\!\!\!\!\!\!\!}\ \ \ \& \ \ \color{#c00}{\varepsilon^2 \equiv 0} \ \ \ \rm so\\[.3em]
&\!\!\dfrac{1}{3n\!-\!2}\equiv\dfrac{1-\color{#c00}{\epsilon^2}}{1+\epsilon\ \ }\equiv 1-\color{}\epsilon \equiv 4\!-\!3n\end{align}$
$\ $ which implies that: $\ \ \ \,(3n\!-\!2)\,x\:\!\equiv\:\! a\, \iff\, x\equiv (4\!-\!3n)\,a$
Remark $ $ The same works for higher powers  $\color{#c00}{\epsilon^k\equiv 0}\,\Rightarrow\, 1+\epsilon\,\mid\, 1 =  1-\color{#c00}{\epsilon^k}.\,$ This simple inversion method is one of the prototypical methods discussed in this answer on "simpler multiple" methods.  More generally this is a special case of successive approximations schemes such as Hensel lifting of solutions, or general Newton's methods.
Or we can invert using the augmented-matrix form of the extended Euclidean algorithm.
$\begin{eqnarray}
[\![1]\!]&&  && &\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! f := 9n\!-\!9\ =&\, \left<\,\color{#c00}1,\,\color{#0a0}0\,\right>\quad\ \  {\rm i.e.}\ \ \ \ \ \ f\, =\ \color{#c00}1\cdot f\, +\, \color{#0a0}0\cdot g\\
[\![2]\!]&&  &&\qquad\ \ \,  g :=3n\!-\!2 &\!\!=&\, \left<\,\color{#c00}0,\,\color{#0a0}1\,\right>\quad\ \ {\rm i.e.}\ \ \ \ \ \  g\, =\ \color{#c00}0\cdot f\, +\, \color{#0a0}1\cdot g\\
[\![3]\!]&=&[\![1]\!]-3[\![2]\!]\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! &&\qquad\qquad\ \ \ \ \ \ \ \ \,{-}3 \,&\!\!=&\, \left<\,\color{#c00}1,\,\color{#0a0}{-3}\,\right>\ \ \ {\rm i.e.}\ \ \  {-}3\, =\, \color{#c00}1\cdot f\,\color{#0c0}{-\,3}\cdot g\\
[\![4]\!]&=&[\![2]\!]+n[\![3]\!]\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! &&\qquad\qquad\qquad\ {-}2 \,&\!\!=&\, \left<\,\color{#c00}{n},\,\color{#0a0}{1\!-\!3n}\,\right>\\
[\![5]\!]&=&[\![4]\!]\ -\ [\![3]\!]\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! &&\qquad\qquad\qquad\ \,&\!\!\!\!\!\! 1\ =&\, \left<\,\color{#c00}{n\!-\!1},\,\color{#0a0}{4\!-\!3n}\,\right>\\
\end{eqnarray}$
Hence the prior line implies: $ \ \ \underbrace{1\:\! =\, (\color{#c00}{n\!-\!1})f + (\color{#0a0}{4\!-\!3n})g}_{\large\text{Bezout equation for }\!\gcd(f,g)}\:\!\Rightarrow\, \smash{\bbox[7px,border:1px solid #c00]{ 1\equiv (4\!-\!3n)g\,\pmod{\!f}}} $
A: Okay... this is a little symbol heavy but you are correct.
This will have a solution if and only if $\gcd(3n-2,9n-9)|-5n$.
Let's work with that first.  Remember Euclids algorithm for finding $\gcd$s:  $\gcd(a, b) = \gcd(a, b - ka)$ and repeat until you can go any further.  Also bear in mind $\gcd(a,b) = \gcd (b,a)$ and $\gcd(a,b)=\gcd(a,-b)$.
$\gcd(3n-2, 9n-9) = \gcd(3n-2, (9n-9)-(9n-6))=$
$\gcd(3n-2, -3) = \gcd(3, 3n-2)=$
$\gcd(3, (3n-2)-3n) = \gcd(3,-2)=$
$\gcd(2,3)\equiv \gcd(2,3-2)=\gcd(2,1)=\gcd(1,2)=\gcd(1,2-1)=\gcd(1,1)=1$.
So this will always have a solution.  Hallelujah!
(Okay, I went a little overboard with figuring the $\gcd$ but... always good to hammer ideas home.)
To solve we must figure what $(3n-2)^{-1} \pmod{9n-9}$ is.
$(3n -2)* K \equiv 1\pmod{ 9n-9}$ what is $K$?
Well, we sort of did that we did Euclids Algorithm. Let's call $3n-2=a$ and $9n-9 = b$
$(9n-9) -3(3n-2) = -3\implies -3 = b-3a$
$(3n-2) +(-3)n = -2 \implies -2=a+(b-3a)n= (-3n+1)a + bn$
$-2 = -3 + 1\implies 1 = -2-(-3) = [(-3n+1)a + bn] -[b-3a]=(-3n+4)a + (n-1)b$.
So $(-3n+4)a \equiv 1 \pmod b$ or
$(-3n+4)(3n-2) \equiv 1 \pmod {9n-9}$ 
So $(3n-2)^{-1} \equiv -3n+4\pmod {9n-9}$and we can verify:
$(-3n+4)(3n-2) \equiv -9n^2 + 18n -8\equiv $
$-9n^2 + 9n + 9n -8 \equiv$
$-n(9n-9) + (9n-9)+1\equiv 1 \pmod{9n-9}$.
Double Hallelujah!.
So finally:
$(3n - 2)x + 5n \equiv 0 \pmod{9n-9}$
$(3n-2)x \equiv -5n \pmod{9n-9}$ so
$(-3n+4)(3n-2)x \equiv -5n(-3n+4) \pmod{9n-9}$ so
$x \equiv 15n^2 - 20n \equiv 6n^2-11n\equiv -3n^2-2n\pmod {9n-9}$
Or $-3n^2 +7n-9$ if that's any easier.
We can verify:
$(3n - 2)(-3n^2-2n) + 5n \equiv$
$-9n^3 +9n \equiv $
$-9n^3 + 9n^2 -9n^n + 9n\equiv$
$-n^2(9n-9) - n(9n -9) \equiv 0 \pmod{9n-9}$.
Triple Hallelujah!  Let's go home and drink coffee.
A: *

*If you think $3n-2$ and $9n-9$ are coprime, use Euclidean division to guess a Bézout relation $$a(3n-2)+b(9n-9)=1$$ for some $a$, $b$ of degree $1$ in $n$.


 $$(4-3n)(3n-2)+(n-1)(9n-9)=1$$


*Multiply both sides of the congruence by $a$ and subtract to get $$x\equiv-5na\pmod{9n-9}$$.


 $$x\equiv 15n^2 - 20n\pmod{9}$$

