Understanding a proof that $17\mid (2x+3y)$ iff $17\mid(9x +5y)$

From $26x+39y$ you can subtract any multiple of $17$, so you can substract $17x+34y$ to get $9x+5y$.


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.