Find $n^2+58n$, such that it is a square number

Another hint. You can look at the problem as a quadratic equation $$x^2+58x-m^2=0$$ with $\Delta=58^2+4m^2$ and (excluding negative $n$'s) $$n=\frac{-58+2\sqrt{29^2+m^2}}{2}=-29+\sqrt{29^2+m^2}$$ which reduces to finding integers of the forms $29^2+m^2=q^2$, which is easier since $29$ is a prime and $$29^2=(q-m)(q+m)$$ allows for the following cases

  • $q-m=29$ and $q+m=29$
  • $q-m=1$ and $q+m=29^2$
  • $q-m=29^2$ and $q+m=1$

Hint: Write your equation in the form $$(n+29)^2=x^2+29^2$$


Hint: \begin{eqnarray}k^2 &=& n^2+58n \\ &=& \underbrace{n^2+2\cdot 29n+\color{red}{29^2}}\color{red}{-29^2} \\ &=& (n+29)^2-29^2\end{eqnarray}

so $$ 29^2 = (n+29)^2-k^2 $$ $$29^2= (n+29+k)(n+29-k)$$