Let $a$ and $b$ be integers. Prove that $\frac{2a^2-1}{b^2+2}$ is not an integer.
I determined that since $2a^2-1 \equiv 1,7 \pmod{8}$ we must have $b^2+2 \equiv 3 \pmod{8}$ in order for the fraction to be an integer. I didn't see how to find a contradiction from here.
Hint: Show that $2a^2-1$ is divisible only by primes $\equiv 1,7\pmod 8$, whereas $b^2+2$ must have a prime divisor not of that form. You already did the latter part.