1

$(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.

3 Answers3

3

$\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}}} $

Bill Dubuque
  • 272,048
2

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.

fleablood
  • 124,253
1
  1. 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$$

  2. 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}$$

K B Dave
  • 7,912
  • $x\equiv 15n^2 - 20n\pmod{9}$ can be further simplified to $6n^2-11n$ or $-3n^2 - 2n$. – fleablood Aug 07 '19 at 17:30
  • I have two questions. 1. How did you get $a,b$ with Euclidean division? It works for me when there are only numbers in it, I don’t understand the procedure where a variable is involved, where do you think I can find an example of how to solve it. 2. Does $15n^2-20n$ is between $0$ and $9n-9$? Because, as I understand it $x$ must be necessarily between that range. – Octavio Berlanga Aug 07 '19 at 17:33
  • $(9n-9)-3(3n-2) =-3; (3n-2) + (-3)n = -2; -2=-3 = 1$ so $1=(-3n+4)(3n-2) + (n-1)(9n-9)$ – fleablood Aug 07 '19 at 17:40
  • $x$ need not be in any range. If $x$ is a solution then so is $x + K(9n-9)$ for any $K$. $15n^2 -20n$ is an acceptable solution. Aos is $6n^2-11n$ and $6n^2 -2n+9$ or ... etc. The point is we aren't talking about individual integers anymore. We are talking about classes of equivalent integers. $15n^2 -20$ and $6n^2- 11n$ are both in the same class of integers that are solutions. As for as modulo equivalence classes we treat them as though they are the exact same thing. – fleablood Aug 07 '19 at 17:45
  • 1
    The problem with trying to find $0\le x < 9n-9$ is that we don't know what $n$ is. I could get to $6n^2 -11n$ which is probably larger than $9n-9$ but I can't figure out that $K(9n-9) < 6n^2-11n < (K+1)(9n-9)$ and do $x = 6n^2 -11n - K(9n-9)$ which would* be the solution you want $0\le x < 9n-9$. The problem is we have utterly no idea what $K$ is if we don't know $n$.... But in modulo arithmetic we don't care! We want a representative solution. And in this case $15n^2 - 20n$ is acceptable. – fleablood Aug 07 '19 at 17:57
  • Alright! Thank you @fleablood – Octavio Berlanga Aug 07 '19 at 18:12