# When is a triangle a square?

Of course a triangle cannot be a square, but a triangular number can be a square number.

A triangular number is the sum of the first so many positive integers. For example, 10 is a triangular number because it equals 1+2+3+4. These numbers are called triangle numbers because you can form a triangle by having a row of one coin, two coin, three coins, etc. forming a triangle.

The smallest number that is both triangular and square is 1. The next smallest is 36. There are infinitely many numbers that are both triangular and square, and there’s even a formula for the nth number that is both a triangle and a square:

((17 + 12√2)n + (17 – 12√2)n – 2)/32

Source: American Mathematical Monthly, February 1962, page 169.

For more on triangle numbers and their generalizations, see Twelve Days of Christmas and Tetrahedral Numbers.

There is also a way to compute the square triangular numbers recursively discussed in the next post.

## 9 thoughts on “When is a triangle a square?”

1. A triangle can’t be a square, but a triangle can have right angles at all three vertices — if the triangle lies on a sphere, and one vertex is a pole.

2. (actually, on second thought, none of the vertices need to be at a pole, it’s just easier to think about it that way — the triangle just needs to cover 1/4 of a hemisphere, oriented any way)

3. Richard

Should mention it’s reference at On-Line Encyclopedia of Integer Sequences. Good comments and more math trivia about the sequence…

https://oeis.org/A001110

4. Jan Van lent

I recently looked into which numbers are both triangular and hexagonal.
They are 1, 91, 8911, 873181, 85562821, …
A recursion is T(n)=99*T(n-1)-99*T(n-2)+T(n-3) and the direct formula
$latex 1/16+ \left( 3/16\,\sqrt {6}+{\frac {15}{32}} \right) \left( 49-20\,\sqrt {6} \right)^{n}+ \left( -3/16\,\sqrt {6}+{\frac {15}{32}} \right) \left( 49+20\,\sqrt {6} \right) ^{n}$.
Note that one of the terms is always small, giving an equivalent formula
$latex \left\lceil {\frac {1}{16}}+ \left( -3/16\,\sqrt {6}+{\frac {15}{32}} \right) \left( 49+20\,\sqrt {6} \right) ^{n}\right\rceil$.

http://oeis.org/A006244

5. SteveBrooklineMA

n*(n+1)/2 = m^2
(2n+1)^2 – 8 m^2 = 1
Pell’s equation?

6. Yes, the problem can be transformed into a case of Pell’s equation. That’s where the solutions come from.

7. Triangular square numbers are helpful for creating knit blankets like this one:

https://www.ravelry.com/patterns/library/data-log

A bonus is that because the strip length is proportional to how far from the center the strip begins, each strip subtends approximately the same angle — a little more than a third of a complete turn.