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.

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, T8 = ½· 8 · 9 = 36 = 62. In general a triangular square is any number n, such that n = ½ a(a + 1) and n = b2, where a and b are whole numbers. So,

In order for b to be a whole number either is a perfect square and is a perfect square (for a even), or a is a perfect square and is a perfect square (for a odd). For example, in the case of T8 above, which is a perfect square, and a + 1 = 9, which is also a perfect square. The next triangular square is T49 = ½ · 49 · 50 = 1225 = 352. In this case, a = 49 is a perfect square and 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 to list of triangle numbers for squares (or the list of squares for triangle numbers)? The fourth triangular square—the first one is T1 = 1 = 12—is T288 = ½ · 288 · 289 = 41,616 = 2042. 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, ...).

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 · 6 – 1 and 204 = 6 · 35 – 6. Let's see if 6 · 204 – 35 = 1189 also leads to a solution. To do so, we need to solve the equation given above for a.

For b = 1189, a = 1681. A quick check of squares between 2042 and 11892 (and triangle numbers between T288 and T1681) 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 nth triangular square without generating all the 1 through n – 1 triangular squares.