Understanding a proof that $17\mid (2x+3y)$ iff $17\mid(9x +5y)$ I was studying the number theory and came across this question. 
Example 1.1. Let $x$ and $y$ be integers. Prove that $2x + 3y$ is divisible by 17 if and only if $9x + 5y$ is divisible by 17.
Solution. $17 \mid (2x + 3y) \implies 17 | [13(2x + 3y)]$, or $17 \mid (26x + 39y) \implies 17 \mid (9x + 5y)$. Conversely, $17 \mid (9x + 5y) \implies 17 \mid [4(9x + 5y)]$, or $17 \mid (36x + 20y) \implies 17 \mid (2x + 3y)$.
I have a difficulty understanding how $$17\mid(26x+39y)$$ implies $$17\mid (9x+5y)$$ and vice versa. 
I know this question as already been asked here but I didn't understand from that answer and since I'm new to Math SE, I don't have enough points to add a comment to that post to clarify that answer.
 A: From $26x+39y$ you can subtract any multiple of $17$, so you can substract $17x+34y$ to get $9x+5y$. 
A: For a different take, consider the matrix $\pmatrix{ 2 & 3 \\ 9 & 5}$.
Its determinant is $-17$, which is $0$ mod $17$.
Therefore, its two rows are linearly dependent mod $17$, which implies the result. (Here it is important that $17$ is prime.)
Explicitly, $a(2x+3y)=9x+5y$ works mod $17$ if $2a \equiv 9 \bmod 17$, that is, for $a=13$, which explains where $13$ came from in the proposed solution.
A: If $a|b$ and $a|c$ then $a|b \pm c$.
And $26x + 39y = (9x + 5y) + 17(x + 2y)$ and $9x+5y = (26x + 39y) - 17(x+2y)$.
And $17|17(x+2y)$ always.
So $17|26x + 39 \implies 17|(26x + 39y) -17(x + 2y) \implies 17|9x +5y$.
And vice versa.
A: I think the "if and only if" (abbreviated "iff" in the title of this question and in the textbook you're studying) is confusing you. It kind of suggests that one requires the other but the other does not necessarily require the one, when in fact the two conditions are mutually dependent: one requires the other and the other requires the one.
Do you remember how to add and subtract binomials from Algebra 101? Align the like terms in columns and then perform arithmetic as usual.
$$\begin{array}{rrrr}
 & 26x & + & 39y \\
- & 9x & + & 5y \\
\hline
= & 17x & + & 34y \\
\end{array}$$
(okay, that's not properly aligned because in the time it takes me to figure out how to do it, twenty other answers will get posted and they'll be like "you copied from me").
Then it's easy to see that $$\frac{17x + 34y}{17} = x + 2y.$$ Since $17x + 34y$ is clearly a multiple of 17, it follows that if you subtract it from another multiple of 17, you will get yet another multiple of 17.

Bonus: if $17 \mid 9x + 5y$, then either $x$ or $y$ may be a square, but not both.
A: Note that $26=17+9$ and $39=34+5$ 
Therefore working in mod (17) you can replace, $26$ with $9$ and $39$ with $5$ 
A: It is worth highlighting a better way to think about such equivalences.
$$\!\bmod n\!:\ A\equiv a\,\Longrightarrow\, (\overbrace{A\equiv 0\iff a\equiv 0}^{\textstyle n\mid A\color{#c00}\iff n\mid a})\qquad\qquad\qquad$$
For $\,a := (A\bmod n)\,$ this yields that  $\,\ \bbox[8px,border:1px solid red]
{n\mid A\color{#c00}\iff n\mid (A\bmod n)}\,\ $
Hence $\ 17\mid 26x+39y\iff 17\mid (26x+39y\,\bmod 17)\equiv 9x+5y$
Remark $\ $ As is clear above, the equivalence is simpler when viewed in congruence (vs. divisibility) form, so it is usually better to work with congruences rather than divisibility relations.
