<s>[INST] solve system of linear congruences mod 13 Given the system:
$$ 2x+5y \equiv 1  \textrm{mod} 13 $$
$$ 5x+y \equiv 2  \textrm{mod} 13 $$
What is the value of 
$$ 5x+7y \equiv   \textrm{mod} 13 $$?
do I have to solve the first two equations, i.e., $x=11+5t, y=1-2t$ for the first equation, do the same for the second, obtain the common values of $x, y $, and do the calculation? or is there other method?
 [/INST] $2x+5y\equiv 1\pmod{13}\implies 2x+5y=1-13a$
$5x+y\equiv 2\pmod{13}\implies 5x+y=2-13b$  for some integers $a,b$.
Solving for $x,y,$ we get, $x=\frac{9+13(a-5b)}{23},y=\frac{1+13(2b-5a)}{23}$
$23(5x+7y)=5(9+13(a-5b))+7(1+13(2b-5a))\equiv 5\cdot9+7\pmod{13}\equiv 0$
$\implies 5x+7y\equiv 0\pmod{13} $ as $(13,23)=1$
Had $ 5x+7y$ not been $\equiv 0\pmod{13} $ we needed to multiply the RHS with  $(23)^{-1}\pmod{13}\equiv (-3)^{-1}$.
Now, $(-3)^2=9,(-3)^3=-27\equiv -1\pmod{13}\implies (-3)^{-1}\equiv -(-3)^2\equiv 4$
</s>