I'm reading Stopple's A Primer of Analytic Number Theory:
Exercise 1.1.3: Which triangular numbers are also squares? That is, what conditions on $m$ and $n$ will guarantee that $t_n=s_m$? Show that if this happens, then we have:
$$(2n+1)^2-8m^2=1,$$
a solution to Pell's equation, which we will study in more detail in Chapter $11$.
I thought about the following:
$$\begin{eqnarray*} {t_n}&=&{s_n} \\ {\frac{n^2+n}{2}}&=&{m^2} \\ {n^2+n}&=&{m^2} \end{eqnarray*}$$
I've solved for $n$ and $m$ but I still have no clue of how to proceed. I've looked at the book's solution and the solution is as follows:
$$\begin{eqnarray*} {\frac{n(n+1)}{2}}&=&{m^2} \\ {n(n+1)}&=&{2m^2} \\ {\color{red}{4n(n+1)}}&\color{red}{=}&{\color{red}{8m^2}} \\ {4n^2+4n+1-1}&=&{8m^2} \\ {(2n+1)^2-1}&=&{8m^2} \\ \end{eqnarray*}$$
In the red line, he multiplies the equation by $4$, I don't understand why to do it nor how the condition is achieved.