Show that the equation $a(a+6)=317b-7$ has no integer solution $(a,b)$ My sketch: Since $$a(a+6)=a^2+6a$$ so $$a^2+6a=317b-7$$ or $$(a+3)^2=317b+2$$ now since $317$ is a prime so left hand side might be divisible by $317$ but not rhs hence it is not possible to have integer solution $(a,b)$.
Please help whether the approach is right or wrong.
Wrong. The right hand side is not divisible by $317$. To get a contradiction from this you have to show the left hand side must be divisible by $317$, "might be" is not good enough.
But you have shown that $2$ is a quadratic residue modulo $317$. This is only possible if $317\equiv\pm1\pmod8$, which is not true.