Update 1: When I wrote this a few years ago, I didn't know that anyone else had ever tried to find all the triangular squares. Turns out lots of folks have been interested in it, and the problem was solved by Euler in 1778. I guess that's what happens when an amateur without much background in number theory strikes off on his own. For more information about triangular squares see the Wikipedia article and its references.

Update 2: I recently revisited the problem because I discovered it was related to the problem of finding a general solution to Pythagorean right triangles where the legs differ by 1. (Examples are the familiar 3,4,5 triangle and the 20,21,29 triangle). It turns out that a Pythagorean triangle whose legs differ by 1 exists for every triangular square. It gives a geometric interpretation to the fact that the ratio between the tk and sk approaches the square root of 2 as k increases. When I get a chance, I'll write an entry about Pythagorean triangles whose legs differ by 1 and their relation to triangular squares.

Simply put, triangular squares are triangle numbers that are also squares. For example, \(T_{8} = {{8 \times 9} \over 2} = 36 = 6^2\). In general a triangular square is any number \(n\), such that \(n = {a(a + 1) \over 2}\) and \(n = b^2\), where \(a\) and \(b\) are whole numbers. So,

$$ b^2 = {a(a + 1) \over 2} \\ b = \pm \sqrt{a(a + 1) \over 2} $$

In order for \(b\) to be a whole number either \(a \over 2\) is a perfect square and \({a + 1}\) is a perfect square (for \(a\) even), or \(a\) is a perfect square and \({a + 1} \over 2\) is a perfect square (for \(a\) odd). For example, in the case of \(T_8\) above, \({8 \over 2} = 4\) which is a perfect square, and \(8 + 1 = 9\), which is also a perfect square. The next triangular square is \(T_{49} = {{49 \times 50} \over 2} = 1125 = 35^2\). In this case, \(a = 49\) is a perfect square and \({{a + 1} \over 2} = {50 \over 2} = 25\) is a perfect square. Is there a way to generate the number \(a\) so that we can find any triangular square without having to search through a list of triangle numbers for squares (or the list of squares for triangle numbers)? The fourth triangular square—the first one is \(T_1 = 1^2 = 1\)—is \(T_{288} = {{288 \times 289} \over 2} = 41,616 = 204^2\). So we have three series of numbers to work with: the triangle numbers (1, 8, 49, 288, ...), the squares (1, 6, 35, 204, ...), and the triangular squares themselves (1, 36, 1225, 41616, ...). Of course, it's easy to find more triangular squares using a computer. (The next one is 1,413,721. See for yourself.) But I would like to find a general method for generating triangular squares from the natural numbers \((1, 2, 3, 4 \dots) \).

As a first step toward our goal, we take note of the fact that the ratio between successive squares is always between 5 and 6. In fact, it appears that \(35 = 6 \times 6 – 1\) and \(204 = 6 \times 35 – 6\). Let's see if \(6 \times 204 – 35 = 1189\) also leads to a solution. To do so, we need to solve the equation given above for \(a\).

$$ \begin {eqnarray} b^2 &=& {a(a + 1) \over 2} \\ 2b^2 &=& a^2 + a \\ a^2 + a - 2b^2 &=& 0 \\ a &=& {-1 \pm \sqrt{1 + 8b^2} \over 2} \end {eqnarray} $$

For \(b = 1189\), \(a = 1681\). A quick check of squares between \(204^2\) and \(1189^2\) (and triangle numbers between \(T_{288}\) and \(T_{1681}\) shows that we didn't miss any in between. This makes a good working method for generating triangular squares, but we are still missing a rigorous proof that the method works for all triangular squares and captures all of them. We also don't have a method for finding the \(n\)th triangular square without generating all the \(1\) through \(n – 1\) triangular squares.