What is the best way to solve a problem given remainders and divisors? $x$ is a positive integer less than $100$.  When $x$ is divided by $5$, its remainder is $4$.  When $x$ is divided by $23$, its remainder is $7$.  What is $x$ ?

So, $x=5y+4$ and $x=23z+7$  for some integers $y,z$
So, $5y+4=23z+7=>5y+20=23z+23$ adding 16 to either sides,
$5(y+4)=23(z+1)=>y+4=\frac{23(z+1)}{5}$, so,$5|(z+1)$  as $y+4$ is integer and $(5,23)=1$
$=>z+1=5w$ for some integer $w$.
$x=23(5w-1)+7=115w-16$
As $0<x<100$ so,$x=99$ putting $w=1$

Alternatively, We have $5y=23z+3$
Using convergent property of continued fractions,
(i)$\frac{23}{5}=4+\frac{3}{5}=4+\frac{1}{\frac{5}{3}}=4+\frac{1}{1+\frac{2}{3}}$
$=4+\frac{1}{1+\frac{1}{\frac{3}{2}}}=4+\frac{1}{1+\frac{1}{1+\frac{1}{2}}}$
So, the last but one convergent is $4+\frac{1}{1+\frac{1}{1}}=\frac{9}{2}$
$=>23\cdot2-5\cdot9=1$
$5y=23z+3(23\cdot2-5\cdot9)=>5(y+27)=23(z+6)=>5|(z+6)=>5|(z+1)$
(ii)$\frac{23}{5}=4+\frac{3}{5}=4+\frac{1}{\frac{5}{3}}=4+\frac{1}{1+\frac{2}{3}}$
$=4+\frac{1}{1+\frac{1}{\frac{3}{2}}}=4+\frac{1}{1+\frac{1}{1+\frac{1}{2}}}$
$=4+\frac{1}{1+\frac{1}{1+\frac{1}{1+1}}}$
So, the last convergent is $4+\frac{1}{1+\frac{1}{1+1}}=\frac{14}{3}$
$=>23\cdot3-5\cdot14=-1$
$5y=23z-3(23\cdot3-5\cdot14)=5(y-42)=23(z-9)=>5|(z-9)=>5|(z+1)$
