If $23|3x+5y$ for some $x,y\in \mathbb{Z}$, then $23|5x-7y$? Let $x,y$ be some integers such that $23|3x+5y$. Show that $23|5x-7y$ as well.
This was my exam question and I did not solve it. Could anyone give some insight how to do this? Even after the exam I can not solve it...
 A: Hint $\bmod 23\!:\ \color{#c00}3x+\color{#0a0}5y\equiv  \color{#c00}{-20}x+\color{#0a0}{28}y = -4(5x-7y)$
Remark $ $ Scaling by a unit $\,u\,$ preserves equations, i.e. $\, ax+by\equiv 0\Rightarrow  uax+uby\equiv 0,\,$ and conversely (by scaling by $\,u^{-1}).\,$
So to find such a scaling we solve for a scaling that maps $\,5x \to 3x,\,$ ie. $\,5u\equiv 3 \iff u\equiv 5/3\equiv -20/3\equiv -4,\,$ and it works since $\,-4(-7y)\equiv 5y.$
Or, geometrically, we can show these lines are equal since they have the same slope $\,y/x\,$ and same point $\,(0,0).\,$ Note that $x\equiv 0\iff y\equiv0\,$. Else $\ x\not\equiv 0\,$ so $\,7y\equiv 5x\iff y/x\equiv 5/7,\,$ and $\, 5y\equiv -3x \iff y/x\equiv -3/5.\,$ These slope fractions $\,\frac{5}7,\, \frac{-3}5\,$ are equal (i.e. congruent $\rm mod\ 23)\,$ because cross multiplication yields  $\, 5(5)\equiv 2\equiv  7(-3)\pmod{23}.$
Here the geometry and linear algebra works as usual since we are working over a coefficient ring that is a field $\,\Bbb Z/23 = $  integers mod $\,23,\,$ i.e. $\,a\not\equiv 0\,\Rightarrow\, a\,$ is a unit (invertible).
A: Divisibility questions are often simpler when rephrased as modular arithmetic. You want to show
$$ 3x + 5y \equiv 0 \pmod{23} \implies 5x - 7y \equiv 0 \pmod{23} $$
A simplistic thing to do is to look at the known equation, and simplify it by solving for $x$
$$ x \equiv 3^{-1} \cdot (-5) y = 6y \pmod{23} $$
and using this to eliminate $x$ from the thing we're trying to prove:
$$ \begin{align} 5x - 7 \equiv 0 \pmod{23} &\iff 5(6y) - 7y \equiv 0 \pmod{23} 
\\&\iff 30y - 7y \equiv 0 \pmod{23}
\\&\iff 0y \equiv 0 \pmod{23}
\end{align}$$
Conveniently, we've accidentally solved the problem in the process of simplifying it!

Another thing to do with it is to use your linear algebra. The set of all solutions for $(x,y)$ in the equation $3x + 5y \equiv 0 \pmod{23}$ is a one-dimensional vector space over the field of 23 elements. Similarly, the set of all solutions to $5x - 7y \equiv 0 \pmod{23}$ is a one-dimensional vector space.
If every solution to the former is truly a solution to the latter, then those have to be the same one-dimensional vector space. And for that to happen, the vectors $(3, 5)$ and $(5, -7)$ must be linearly dependent.
We could try to see that one of these vectors is a multiple of the other one, but it is even easier (no modular division involved!) to check the determinant of the matrix
$$ \left[ \begin{matrix} 3 & 5 \\ 5 & -7 \end{matrix}  \right]$$
is zero. And indeed,
$$3 \cdot (-7) - 5 \cdot 5 = -21 - 25 = -46 \equiv 0 \pmod{23} $$
It is important that $23$ is prime; linear algebra is a bit more subtle if you try to work in the ring of integers modulo a composite number.
A: High-level approach. We have the field $\mathbb{F}_{23}$ and the homomorphism $f: \mathbb{F}_{23}^2 \to \mathbb{F}_{23}$ of vector spaces defined by the formula $f(m, n) = mx + ny$, where $x$ and $y$ are fixed scalars. We know that $f(3, 5)=0$ and we want to show that $f(5, -7)=0$.
In other words, we know that $(3, 5) \in \ker f$ and we want to show that $(5,-7) \in \ker f$. To prove this, it is sufficient to show that $(5, -7)$ belongs to the linear span $\langle (3, 5) \rangle$. But this is the same as to say that $5/-7 = 3/5$ in the field $\mathbb{F}_{23}$, which is equivalent to the congruence of integers:
$$
5 \cdot 5 \equiv 3 \cdot (-7) \mod 23.
$$
This congruence is true, therefore we are done. Note how we didn't have to lucky-guess anything.
A: Here's a systematic approach.
Because $\gcd(23,3)=1$, you can get $23\mid x+ay$ like this:
$$23\mid3x+5y\Longrightarrow23\mid8(3x+5y)-23x=x+40y\Longrightarrow23\mid x-6y$$
Then just multiply by 5 and you get what you wanted: $$23\mid5(x-6y)=5x-30y\Longrightarrow23\mid5x-7y$$
A: One idea can be eliminating a variable 
$$5(3x+5y)-3(5x-7y)=46y\iff5(3x+5y)=46y+3(5x-7y)$$ or $$7(3x+5y)+5(5x-7y)=46x\iff7(3x+5y)=46x-5(5x-7y)$$ 
Observe that if $23|(3x+5y), 23$ must divide $(5x-7y)$ as $(3,23)=1=(5,23)$ and vice versa  
