$5$ divides $2ax+b$ for some integer $a$,given $5$ does not divide $x$ $x$ and $b$ are given.Let,$5$ does not divide $x$.
Then $5$ divides $2ax+b$ for some integer $a$.
How do i prove this? I have not gone through a course in number theory,so a general proof would be appreciated.
 A: Framing your question around modular arithmetic makes things much easier. You want to show that if $x\not\equiv 0\pmod{5}$ then there is an $a$ such that $2ax\equiv -b\pmod{5}$. But $2x$ clearly has an inverse $\pmod{5}$ so setting $a\equiv (2x)^{-1}(-b)\pmod{5}$ we have our solution.
In case you're not too familiar with modular arithmetic, think of it like this. We can set $x=5q+r$ by the division algorithm, where $0<r<5$ ($r\ne 0$ because $5$ does not divide $x$). Then we can find a value for $a$ depending on $r$:
$$a=\begin{cases}-3b&r=1\\
-4b&r=2\\
-b&r=3\\
-2b&r=4\end{cases}$$
It is simple to check that each of these cases are satisfied by simply factoring out the $5$ in each $2ax+b$
A: The slightly stronger statement holds true that $\,2ax+b\,$ is a multiple of $\,5\,$ for an $\,a \in \{0, \pm 1, \pm 2\}\,$.
If $\,b\,$ is a multiple of $\,5\,$ then $\,2 \cdot 0 \cdot x+b=b\,$ is a multiple of $\,5\,$, so $\,a=0\,$ works.
Otherwise, note first that if $\,u\,$ is not a multiple of $\,5\,$ then $\,u^4 = \mathcal{M}5+1\,$ where the notation $\,\mathcal{M}5\,$ denotes any integer multiple of $\,5\,$. This follows directly from Fermat's little theorem, but is also easy to prove in this case, as to keep the answer self-contained and largely number-theory-free. Any number $\,u\,$ which is not a multiple of $\,5\,$ must be in one of two forms:


*

*if $\,u=\mathcal{M}5 \pm 1\,$, then $\,u^2= (\mathcal{M}5)^2 \pm 2 \cdot \mathcal{M}5+(\pm 1)^2 = \mathcal{M}5+1\,$, then $\,u^4=\left(u^2\right)^2$ $=\mathcal{M}5+1\,$ by the same argument;

*if $\,u=\mathcal{M}5 \pm 2\,$, then $\,u^2= (\mathcal{M}5)^2 \pm 4 \cdot \mathcal{M}5+(\pm 2)^2 = \mathcal{M}5+4 = \mathcal{M}5 - 1\,$, then $\,u^4=\left(u^2\right)^2$ $=\mathcal{M}5+1\,$ by the same argument as above.
Then what remains to be proved is that one of the numbers obtained for $\,a \in \{\pm 1, \pm 2\}\,$ is a multiple of $\,5\,$. Those numbers are $\,b-4x, b-2x, b+2x, b+4x\,$, and their product is:
$$
(b^2-4 x^2)(b^2-16 x^2) = b^4 + 64 x^4 - 20 b^2x^2 = b^4 -x^4 + 65 x^4 - 20 x^2b^2 = b^4 - x^4 +\mathcal{M}5
$$
But neither of $\,b, x\,$ is a multiple of $\,5\,$, so $\,b^4-x^4=(\mathcal{M}5+1)-(\mathcal{M}5+1)=\mathcal{M}5\,$, and therefore one of the factors $b-4x, b-2x, b+2x, b+4x$ must be a multiple of $\,5\,$.
