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.

8 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. 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$.


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

Leave a Reply

Your email address will not be published. Required fields are marked *