my friend sent me a problem about the number of "Square and Triangular in the same time" numbers and the formula which generates them if possible $$\text {We know that: }T_m = \frac {m (m+1)}2 \quad S_n=n^2\\ \exists^{\infty}? (n,m)\in\mathbb{N}^2 :\quad m^2+m-2n^2=0$$ (My question is not about the solution, but the approach.) I solved that problem(yes there exist infinitely such numbers), but I used some methods that require a "Good Luck" For exemple I searched the first two no zero solutions then i built the next one from them and so on $$(n_1,m_1)=(6;8),(n_2,m_2)=(35;49): \quad n_3\approx \frac{n_2^2}{n_1}\\ m_3\approx \frac{m_2^2}{m_1}$$ Then I assumed that $n_{p+2} = a n_{p+1} + b n_p$ Using the known values i searched for $a $ and $b $ and solved $x^2 - ax - b=0$. The roots were $x_{1/2}=3\pm 2\sqrt {2}$ and then I assumed again that $n_p = \alpha x_1^p + \beta x_2^p$ And finally I got $$n_p = \frac {4+3\sqrt{2}}{8}(3+2\sqrt {2})^p +\frac {4-3\sqrt{2}}{8}(3-2\sqrt {2})^p $$ And for $m_p $ I solved with respect to $m_p : m_p^2-m_p-2n_p^2=0$ and after taking the positive solution: $$m_p = -\frac12 +\sqrt {2}\left(\frac {4+3\sqrt{2}}{8}(3+2\sqrt {2})^p -\frac {4-3\sqrt{2}}{8}(3-2\sqrt {2})^p\right)$$ For this problem (and generally any second-degree two-variables diaphontine equation)
Did my approach include all solutions?
Does the assumption '$n_{p+2} = a n_{p+1} + b n_p$' work in general, and why?
Does the assumption '$n_p = \alpha x_1^p + \beta x_2^p$' work in general, and why?
Can you give me a better approach? (I wanted to consider the equation as that of a conic but I didn't know what to do further)
For this type of problems, what are the most effecient approaches?
To avoid an answer getting to long, I here give the proof of the mentioned reccurence relation.
The smallest solutions of the Pell-equation are $(3,2)$ and $(17,12)$. If $(u,v)$ is a solution, then the next two solutions are given by
$$(3u+4v,2u+3v)$$ and $$(17u+24v,12u+17v)$$
To show that the $u's$ and the $v's$ satisfy the relations
$$u_{n+1}=6u_n-u_{n-1}$$ and $$v_{n+1}=6v_n-v_{n-1}$$
(which must be either guessed or known, there is a related question mentioning these relations. To be honest, I have no idea to find such relations in general.)
you simply use $17u+24v=6(3u+4v)-u$ and $12u+17v=6(2u+3v)-v$ and apply induction over $n$. It is easy to show that the $B_n$'s which are just the halves of the $v's$ satisfy the same relation : $B_{n+1}=6B_n-B_{n-1}$. The first two values are $1$ and $6$ because $v$ starts with $2$ and $12$.