Four positive integers , , , and satisfy
and .
I. We calculate a:
$$\small{\text{$
\begin{array}{lrcl}
(1) & ab+a+b &=& 524 \\\\
& b(1+a)+a &=& 524\\\\
& b &=& \dfrac{524-a} {1+a} \\\\
(2) & bc + b + c &=& 146 \\\\
& b(1+c)+c &=& 146 \\\\
& b &=& \dfrac{146-c}{1+c}\\\\
\\
\hline
\\
(1) = (2) & b = \dfrac{524-a} {1+a} &=& \dfrac{146-c}{1+c}\\\\
& \dfrac{524-a} {1+a} &=& \dfrac{146-c}{1+c}\\\\
& (1+c)(524-a) &=& (1+a)(146-c)\\\\
& (524-a)+c(524-a) &=& 146(1+a)-c(1+a)\\\\
& c(524-a +1+a) &=& 146(1+a)-(524-a)\\\\
& c\cdot 525 &=& 146(1+a)-524+a\\\\
& c\cdot 525 &=& 146 +146a-524+a\\\\
& c\cdot 525 &=& -378+147a\\\\
& c\cdot 525 &=& -378+147a\\\\
& \mathbf{c }& \mathbf{=}& \mathbf{ -0.72 + 0.28a } \qquad | \qquad \cdot 25\\\\
& \mathbf{25c }& \mathbf{=}& \mathbf{ -18+ 7a } \\\\
& \mathbf{-25c+7a }& \mathbf{=}& \mathbf{ 18 }
\end{array}
$}}$$
First we have find the solution for -25c + 7a = -1. And then we can multiply by (-18)
There is only a solution when gcd( -25,7) = -1 or in other words -25 and 7 are relatively prime.
(gcd = greatest common divisor)
Using the Euclidian algorithm to calcutate gcd(-25,7)
$$\small{\begin{array}{|r|r|r|r|}
\hline&&&\\
& & q& r \\
\hline &&&\\
-25 & 7 & -3 & -4 \\
7 & -4 & -1 & 3 \\
-4 & 3 & -1 & \textcolor[rgb]{1,0,0}{-1} \\
3 & -1 & -3 & 0 \\
&&&\\
\hline\end{array}}$$
The greatest common divisor gcd(-25,7) $$\textcolor[rgb]{1,0,0}{=-1}$$
Using Extended Euclidean algorithm to calculate the first solution
$$\small{\begin{array}{|r|r|r|r||r|r|}
\hline&&&&&\\
& & q& r &c&a\\
\hline &&&&&\\
-25 & 7 & -3 & -4 & \textcolor[rgb]{1,0,0}{2} & 1-(-3)(2) = \textcolor[rgb]{1,0,0}{7}\\
7 & -4 & -1 & 3 & 1 & 1 -(-1)\cdot 1 = 2\\
-4 & 3 & -1 & -1 & 1 & 0 - (-1)\cdot 1 = 1 \\
3 & -1 & -3 & 0 & 0 & 0\cdot 3 -1 = 1\\
&&&&&\\
\hline\end{array}}$$
The first solution $$a_0$$ and $$c_0$$: -25c + 7a = -1
$$\small{\text{$
\begin{array}{rcl}
-25(2) + 7(7) &=& -1 \qquad | \quad \cdot(-18) \\
-25[2\cdot (-18) ] + 7 [7\cdot (-18) ] &=& 18 \\
-25\cdot (-36) + 7 \cdot (-126) &=& 18 \\
\end{array}
$}}$$
$$\small{\text{ The first solution is $ (-36,-126) \qquad -25 \cdot (\textcolor[rgb]{1,0,0}{ -36} ) + 7 \cdot (\textcolor[rgb]{1,0,0}{-126}) = 1 $}}\\\\$$
Next positive solution:
$$\small{\text{$
\begin{array}{lcl}
\boxed{
C\cdot c_0 + A \cdot a_0 = -1 }\\\\
\mathrm{First~ solution~~} (c_0,~ a_0)\\
\mathrm{All~ solutions~~} \left(c_0+\dfrac{z\cdot A}{ gcd(C,A) } ,~ a_0 - \dfrac{z\cdot C}{ gcd(C,A) }\right)\\
\end{array}
$}}\\\\$$
$$\small{\text{$
\begin{array}{lcl} \boxed{-25\cdot c + 7 \cdot a = 18 }\\\\
\mathrm{First~ solution~~} (c_0=-36,~ a_0=-126)\\
\mathrm{All~ solutions~~} \left(-36-\dfrac{z\cdot 7}{ -1 } ,~ -126 + \dfrac{z\cdot (-25) }{ -1 }\right)\\
\end{array}$}}\\\\$$
we have:
$$\small{\text{$
\begin{array}{lcl} \left\{~\left(~ -36 + 7\cdot z,~ -126 +25\cdot z\right)~|~z \in Z ~ \right\} \\
\end{array} $}}$$
c = -36+7*6 = 6
a = -126 + 25*6 = 24
$$\small{\text{$
\begin{array}{lcl}
b &=& \dfrac{524-a} {1+a} \\\\
b &=& \dfrac{524-24} {1+24} \\\\
b &=& \dfrac{500} {25} \\\\
\mathbf{b} &\mathbf{=}& \mathbf{20}
\end{array}
$}}$$
$$\small{\text{$
\begin{array}{lcl}
cd+c+d &=& 104\\\\
d &=& \dfrac{104-c} {1+c} \\\\
d &=& \dfrac{104-6} {1+6} \\\\
d &=& \dfrac{98} {7} \\\\
\mathbf{d} &\mathbf{=}& \mathbf{14}
\end{array}
$}}$$
check:
$$a\cdot b \cdot c \cdot d = 24 \cdot 20 \cdot 6 \cdot 14 = 8! = 40320 \qquad \text{ okay }$$