To solve $\, \overbrace{154x\equiv 14\pmod{\!\!182}}^{\textstyle \color{#90f}{154}x = \color{#0a0}{14}\ \, +\, \ \color{#90f}{182}\,k \ }\!,\,$ note $\, \overbrace{\color{#c00}{14}\!=\!\gcd(\color{#90f}{154,182})\mid\color{#0a0}{14}}^{\large \text{necessary condition}}\,$ so we can cancel $\color{#c00}{14},\,$ i.e.
$\qquad\quad\ \underbrace{\textstyle\ \ \, 182\mid 154\,x-14}_{\,\Large \color{#c00}{14}\cdot 13\,\mid\, \color{#c00}{14}\,(11x-1) }\!\!\!\overset{\rm\ \ cancel\ \color{#c00}{14}_{\phantom{I_I}}\!\!\!\!}\iff\, 13\mid 11x\!-\!1\!\iff\! {\rm mod}\ \ 13\!:\ x\equiv \dfrac{1}{11}\equiv \dfrac{-12}{-2}\equiv 6$
Below we do the above in fractional form (as often this simplifies matters). Then we show how to present the extended Euclidean algorithm succinctly using these (multi-valued) modular fractions. Below using $\:\!154\equiv\:\! \color{#0a0}{-2}\cdot \color{#c00}{14}\pmod{\!182},\,$ and using the method explained below we obtain
$\qquad\ \ \ x\equiv \dfrac{14}{154}\equiv \dfrac{\color{#0a0}1\cdot\color{#c00}{14}\!\!\!\!}{\color{#0a0}{-2}\cdot \color{#c00}{14}}\pmod{\!\color{#0a0}{13}\cdot \color{#c00}{14}} \equiv \color{#0a0}{\dfrac{1}{-2}}\equiv 6 \pmod{\!\color{#0a0}{\!13}},\, $ by $\ \color{#0a0}1\equiv -12$
where we have cancelled $\,\color{#c00}{14}\,$ $\rm\color{darkorange}{everywhere}\,$ (fraction and modulus) per the method below, then we twiddled $\,\color{#0a0}{1/(-2)}\,$ to get an exact quotient $-12/(-2)\equiv 6\,$
Generally let's consider the solution of $\ B\, x \equiv A\pmod{\! M}.\ $ Let $\,d=(B,M).\,$ Then $\, d\mid B,\,\ d\mid M\mid B\,x\!-\!A\,\Rightarrow\, d\mid A\ $ is a necessary condition for a solution $\,x\,$ to exist.
If so let $\ m, a, b \, =\, M/d,\, A/d,\, B/d.\ $ Cancelling $\,d\,$ $\rm\color{darkorange}{everywhere}$ i.e. from $\,A,B\,$ & $M$ yields
$$\ x\equiv \dfrac{A}B\!\!\!\pmod{\!M}\!\!\!\overset{\rm def\!}\iff M\mid B\,x\!-\!A \!\!\overset{\rm\large\ \, cancel \ d}\iff\, m\mid b\,x\! -\! a \overset{(b,m)=1}\iff x\equiv \dfrac{a}b\!\!\!\pmod{\!m}\qquad$$
The "fraction" $\, x\equiv A/B\pmod{\! M}\,$ denotes all solutions of $\ Ax\equiv B\pmod{\!M},\,$ There may be zero, one, or multiple solutions so it's a multi-valued fraction $\!\bmod M,\,$ but single-valued $\!\bmod m$.
The above implies that if solutions exist then we can compute them by cancelling $\,d = (B,M)\,$ $\rm\color{darkorange}{everywhere},$ i.e. from the numerator $A,\,$ the denominator $B,\,$ $\rm\color{darkorange}{and}$ the modulus $M,\,$ i.e.
$$ x\equiv \dfrac{ad}{bd}\!\!\!\pmod{\! md}\iff x\equiv \dfrac{a}b\!\!\!\pmod{\! m}\qquad $$
where $\bmod m\!:\ a/b = ab^{-1}\,$ uniquely exists as $\,b^{-1}\,$ does, by $\,(b,m)=1$.
If $\, d>1\, $ the fraction $\, x\equiv A/B\pmod{\!M}\,$ is multiple-valued, denoting the $\,d\,$ solutions
$$\quad\ \begin{align} x \equiv a/b\!\!\pmod{\! m}\, &\equiv\, \{\, a/b + k\,m\}_{\,\large 0\le k<d}\!\!\pmod{\!M},\,\ M = md\\[.3em]
&\equiv\, \{a/b,\,\ a/b\! +\! m,\,\ldots,\, a/b\! +\! (d\!-\!1)m\}\!\!\pmod{\! M}
\end{align}$$
which is true because $\ km\bmod dm =\, (\color{#c00}{k\bmod d})\, m\ $ by the mod Distributive Law, $ $ and the RHS takes exactly $\,d\,$ values, namely $\,\color{#c00}0m,\, \color{#c00}1m,\, \color{#c00}2m, \ldots, (\color{#c00}{d\!-\!1})m,\, $ so ditto for their shifts by $\,a/b,\,$ e.g.
$$x\equiv\!\!\!\! \overbrace{\dfrac{6}3\!\!\!\!\pmod{\!12}}^{{\rm\large cancel}\ \ \Large (3,12)\,=\,3}\!\!\!\!\equiv \dfrac{2}{1}\!\!\!\!\pmod{\!4}\,\equiv\, \!\!\!\!\!\!\!\!\!\!\!\!\!\overbrace{\{2,6,10\}}^{\qquad\ \ \Large\{ 2\,+\,4k\}_{\ \Large 0\le k< 3}}\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\pmod{\!12}\qquad $$
Checking shows $\,3x\equiv 6\pmod{12}\iff x\equiv 2,6,10,\, $ as we calculated above.
Remark $ $ Such multiple-valued fractions prove convenient in the extended Euclidean algorithm when performed in fractional form. Let's use it to compute $\, x\equiv \color{#0a0}{9/5}\pmod{\!18}.\,$ We obtain
$${\rm mod}\ 18\!:\ \ \ \underbrace{\overbrace{\dfrac{0}{18}\overset{\large\frown}\equiv \color{#0a0}{\dfrac{9}5} \overset{\large\frown}\equiv \color{#90f}{\dfrac{9}3}}^{\Large\ \ 0\,-\,\color{#c00}3(\color{#0a0}9)\ \equiv\ \color{#90f}9\ }}_{\Large 18\,-\,\color{#c00}3(\color{#0a0}5)\ \equiv\ \color{#90f}3}\overset{\large\frown}\equiv \dfrac{0}{2}\overset{\large\frown}\equiv \color{darkorange}{\dfrac{9}{1}}\overset{\large\frown}\equiv\dfrac{0}0\!\!\!\!\! $$
so $\ {\rm mod}\ 18\!:\ x\equiv\color{#0a0}{9/5}\equiv\color{darkoraNGE}{ 9/1}\equiv 9.\,$ Checking $\, 5x\equiv 5\cdot9\equiv 45\equiv 9,\,$ is indeed true. Expressed equivalently in terms of equations (congruences) the above becomes (e.g. also short & long)
$$ \begin{align}
\bmod 18\!:\ \ \ \ \ \ \ \
[\![1]\!]\ \ \ \ 18\, x&\,\equiv \ 0\ \\
\color{#0a0}{[\![2]\!]} \ \ \ \ \ \ \color{#0a0}{5\,x}&\ \color{#0a0}{ \equiv\ 9}\!\!\!\\
[\![1]\!]-\color{#c00}3\,\color{#0a0}{[\![2]\!]} \rightarrow \color{#90f}{[\![3]\!]}\ \ \ \ \ \ \color{#90f}{3\,x} &\ \color{#90f}{\equiv\ 9}\ \\
[\![2]\!]\ \:\!-\:\!\ [\![3]\!] \rightarrow [\![4]\!] \ \ \ \ \ \ \color{90f}{2\,x}&\ \color{90f}{ \equiv\ 0}\\
[\![3]\!] \:\!\ - \:\!\ [\![4]\!] \rightarrow [\![5]\!] \ \ \ \ \ \ \color{darkorange}{1\,x}&\ \color{darkorange}{ \equiv\ 9}
\end{align}\qquad\qquad\qquad\qquad$$
Above each Euclidean reduction step essentially mods out successive denominators as follows
$$ \dfrac{a}{b}\overset{\large\frown}\equiv\dfrac{c}d\overset{\large\frown}\equiv\dfrac{a-\color{#c00}q\:\!c}{b-\color{#c00}q\:\!d}\ \ {\rm where}\ \ \color{#c00}q = \lfloor b/d \rfloor,\ \ {\rm so }\ \ b\!-\!qd \,=\, b\bmod d$$
i.e. the denominators are the values occurring in Euclid's algorithm for $\,\gcd(18,\color{#0a0}5),\,$ but we perform those operations in parallel on the numerators too, e.g. the first step above has $\, \color{#c00}q =\lfloor 18/\color{#0a0}5\rfloor = \color{#c00}3\,$
$\begin{align}
\text{thus the next numerator is } &\,\ \ 0-\color{#c00}3(\color{#0a0}9)\equiv \color{#90f}9.\ \text{Executing same operation on denominators}\\
\text{yields next denominator is } &\, 18-\color{#c00}3(\color{#0a0}5)\equiv \color{#90f}3.\ \text{The following steps proceed the same way}\\
\end{align}$
but it happens that all quotients (except final $\,q=2)$ have $\,q=1,\,$ so we simply subtract successive numerators and denominators.
The invariant in the algorithm is that the common solutions of each neighboring pair of fractions remains constant. It starts as the common solution of $\,0/18\overset{\large\frown}\equiv 9/5$ $\,:= 18x\equiv 0,\ 5x\equiv 9.\,$ which is equivalent to $\,5x\equiv 9,\,$ since $\,18x\equiv 0\,$ is true for all $\,x\,$ by $\,18\equiv 0.\,$ Similarly it ends with the common solution of $\,9/1 \overset{\large\frown}\equiv 0/0\,$ $:= 1x\equiv 9,\ 0x\equiv 0,\,$ and again the latter can deleted.
The proof that the Euclidean reduction preserves the solution set is as follows.
$\qquad\ \ $ If $\,\ \color{#0a0}{dx\!-\!c \equiv 0}\,\ $ then $\,\ bx\!-\!a \equiv 0\! \iff\! \underbrace{(bx\!-\!a)-q(\color{#0a0}{dx\!-\!c})}_{\Large (b-qd)\,x\,-\,(a-qc)}\!\equiv 0$
This immediately implies that $\ \ \begin{align}bx&\equiv a\\ dx&\equiv c\end{align}$ $\!\iff\!\! \begin{align}(b\!-\!qd)x&\equiv a\!-\!qc\\ dx&\equiv c\end{align}$
It is instructive to look at the intermediate system $\, 9/3\overset{\large\frown}\equiv 0/2.\,$ By above we know that
$$\begin{align} &\overbrace{\dfrac{9}3\!\!\!\pmod{\!18}}^{{\rm\large cancel}\ \ \Large (3,18)\,=\,3}\!\!\!\equiv\, \dfrac{3}{1}\!\!\!\pmod{\!6}\,\equiv\, \{3,\color{#c00}9,15\}\!\!\!\pmod{\!18} \\[.7em]
& \underbrace{\dfrac{0}2\!\!\!\pmod{\!18}}_{{\rm\large cancel}\ \ \Large (2,18)\,=\,2}\!\!\!\equiv\, \dfrac{0}{1}\!\!\!\pmod{\!9}\,\equiv\, \{0,\color{#c00}9\}\ \ \ \pmod{\!18}
\end{align}\quad\ \ $$
Notice that the common solution of both is indeed $\,\ x\equiv \color{#c00}9\pmod{\!18},\, $ as we found above. Note also that even though we started with a fraction $\,9/5\,$ whose denominator $\,5\,$ is coprime to the modulus $\,18\,$ (so the fraction is single-valued), the Euclidean algorithm passes through various multiple-valued fractions (with non-coprime denominators), even systems with both fractions multiple-valued, such as $\, 9/3\overset{\large\frown}\equiv 0/2\,$ above, i.e. the system $\, 3x\equiv 9,\ 2x\equiv 0\pmod{\!18}.$
The chosen notation $\,\large \frac{a}b \overset{\frown}\equiv \frac{c}d\,$ resembles a padlock (and a congruence combined with intersection) in order to emphasize that the fractions are locked together via intersection - generally we cannot separate the fractions - rather, the solution is the intersection of the
adjacent multivalued fractions, so it is not necessarily equal to either one of them (as in the example above). More generally when we have more than two fractions (or equations) this can be done by crossing out those fractions (or equations) which have been eliminated (above it is all except two most recent).
Such calculations are more commonly expressed without fractions by instead performing operations on systems of equations (as in above example) - operations generalizing Gaussian elimination and triangularization, e.g. reduction of matrices to Hermite /Smith normal form. These topics are studied more abstractly in the theory of modules in abstract algebra (essentially generalizing linear algebra to allow scalars from a ring, not only a field).
Utilizing the Chinese Remainder Theorem to solve this equation?
And correct me if I am wrong, but I thought that the Chinese Remainder Theorem only applied to values that are co-prime.
– Jesse Daniel Mitchell Dec 10 '16 at 23:21