[Math] Square-Trangular Numbers Checking Answer

number theory

Problem: The first 2 numbers that are both squares and triangles are 1 and 36. Find the next one and if possible, the one after that.

Answer: 1225, 41616

Problem: Can you figure out an efficient way to find triangular-square numbers?

Answer: $s^2 = t(t+1)/2$, where $s,t \epsilon{} \textbf{Z}$.

Problem: Do you think that there are infinitely many?

Answer: Yes. (Can someone give me an justification for my answer?)

Best Answer

Your answer is correct: the third and fourth both-triangular-and-square numbers are 1225 and 41616. There are infinitely many such numbers, all of them being solutions to the equation $s^2 = \frac{1}{2}t(t+1)$ in integers. What you didn't provide is an efficient method for finding further solutions to this equation.

The equation can be rewritten as $(2t+1)^2 - 8s^2 = 1$, which is just a slightly disguised Pell's equation. There are a few general methods for solving such equations. Applying one of them to your case yields a simple recurrence for values of $s$: $s_0=0$, $s_1=1$, $s_{k+2} = 6s_{k+1} - s_k$.

Related Question