<s>[INST] Number Theory : Solve the system of congruence $28x+17y\equiv 18 \pmod{41}$ and $31x+11y\equiv 35\pmod{41}$ Number Theory : Solve the system of congruence
(1)    $28x+17y\equiv 18 \pmod{41}$
(2)   $31x+11y\equiv 35\pmod{41}$
Attempt :
we know that equation (1) and (2) are in the same$\pmod{41}$. so we can use Modular arithmetic
lets multiply the first equation (1) by $31$ and the second equation(2) by $28$.
(1)    $31\cdot(28x+17y)\equiv 31\cdot18 \pmod{41}$
(1) $868x+527y\equiv 558\pmod{41}$
(2)   $28\cdot(31x+11y)\equiv 28\cdot35\pmod{41}$
(2) $868x+308y\equiv 980\pmod{41}$
So finally we can subtract equation (1) from (2) we get:
$219y\equiv -422\pmod{41}$
lets check the $\gcd(219,41)$ by Euclidian algorithm :
$219 = 41\cdot 5 + 14$
$41= 14\cdot 2 + 13$
$14= 13\cdot 1 + 1$
$\gcd(219,41)=1$
Hence, because the $\gcd$ is equal to $1$ we can find the Inverse and multiply the equation by the Inverse to find $y$.
$219y\equiv 1\pmod{41}$
$219a = 1+41k$ , the $41k$ must end with the digit of $8$ for $1+$digit $8$ will be $9$ so $k$ must be multiply of number with end digit of $8$.
I don't know how to continue from here .
 [/INST] Let $p \in \Bbb N$ be a prime number.
Recall the following two facts from elementary number theory:
Let $p$ be a prime integer.
For all $u,v,w \in \Bbb Z$ satisfying $u\not\equiv 0 \pmod{p}$, $v\not\equiv 0 \pmod{p}$ and $w\not\equiv 0 \pmod{p}$,
$\tag 1 u \equiv v \pmod{p} \; \text{ iff } \; uw \equiv vw \pmod{p}$
If $a \in \Bbb N$ and $a\not\equiv 0 \pmod{p}$ and $a\not\equiv 1 \pmod{p}$ then there exist $q \in \Bbb Z$ and $r \in \Bbb N$ such that
$\tag 2 aq \equiv r \pmod{p} \; \text{ and } \; 1 \le r \lt p \; \text{ and } \; r \lt a$
The above theory is the counterpart to algorithms that compute the inverse
of non-zero elements in $(\mathbb{Z}/p\mathbb{Z})^\times$.

We are now ready to continue where the OP left off.
Since
$\quad 219y\equiv -422\pmod{41} \; \text{ iff } \; 14y\equiv 29\pmod{41}$
we are motivated to 'divide' (with a small negative residue) $41$ by $14$ and write ,
$\quad 41  = 14 \cdot 3 - 1$
and set $q = 3$.
Next,
$\quad 14y\equiv 29\pmod{41} \; \text{ iff } \; (3 \cdot 14) y\equiv 3 \cdot 29\pmod{41}  \; \text{ iff } \;  1y\equiv 5 \pmod{41}$
and the OP's problem is solved in one step.
By being flexible with the sign of the residue, this is a one step solution. If you can only perform Euclidean division, this is what happens:
Presented with
$\quad 14y\equiv 29\pmod{41}$
we divide $41$ by $14$ and write ,
$\quad 41  = 14 \cdot 2  + 13$
and set $q = -2$.
Next,
$\quad 14y\equiv 29\pmod{41} \; \text{ iff } \; (-2 \cdot 14) y\equiv (-2 \cdot 29)\pmod{41}  \; \text{ iff } \; 13 y\equiv 24 \pmod{41}$
and write
$\quad 41  = 13 \cdot 3  + 2$
and set $q = -3$
Next,
$\quad 13y\equiv 24\pmod{41} \; \text{ iff } \; (-3 \cdot 13) y\equiv (-3 \cdot 24)\pmod{41}  \; \text{ iff } \; 2 y\equiv 10 \pmod{41}$
and write
$\quad 41  = 2 \cdot 20  + 1$
and set $q = -20$
Next,
$\quad 2 y\equiv 10 \pmod{41} \; \text{ iff } \; (-20 \cdot 2) y\equiv (-20 \cdot 10)\pmod{41}  \; \text{ iff } \; 1y\equiv 5 \pmod{41}$
and the OP's problem is solved in $3$ steps.
</s>