Let \(a, b,\) and \(c\) denote the sides of a right triangle such that \(c^2 = a^2 + b^2\). We are interested in triangles where the legs differ by 1, i. e., \(c^2 = a^2 + (a + 1)^2\). Let's recast the equation so all numbers differ from \(a\). Thus, $$(a + m)^2 = a^2 + (a + 1)^2$$ Regrouping and solving for \(a\) we get $$a = (m - 1) \pm \sqrt{2m(m - 1)}$$ Clearly, an integer solution for \(a\) exists only when \(2m(m - 1)\) is a perfect square. It's not hard to find the first few values of \(m\) that yield a perfect square for \(2m(m - 1)\). They are 1, 2, 9, 50, and 289. Here is a table showing the values for \(a, b\) and \(c\) for the given values of \(m\).

m | a | b | c |

1 | 0 | 1 | 1 |

2 | 3 | 4 | 5 |

9 | 20 | 21 | 29 |

50 | 119 | 120 | 169 |

289 | 696 | 697 | 985 |

I noticed two things of interest about this table. The first is that after the first row, each \(m\) is the sum of \(b\) and \(c\) from the previous row. So the next rows in the table would be:

1,682 | 4,059 | 4,060 | 5,741 |

9,801 | 23,660 | 23,661 | 33,461 |

57,122 | 137,903 | 137,904 | 195,025 |

332,929 | 803,760 | 803,761 | 1,136,689 |

1,940,450 | 4,684,659 | 4,684,660 | 6,625,109 |

The second thing I noticed is that each \(m\) is 1 more than the index of a corresponding square triangle. For example, \(T_{288} = 41,616\) which is also a perfect square, \(204^2\). This makes sense because we were looking for values of \(m\) such that \(2m(m - 1)\) is a perfect square, and that is the same as looking for values of \(m\) such that \(4T_{m - 1}\) is a perfect square. So for every square triangle there is a Pythagorean triple such that \(a\) and \(b\) differ by 1, and for every Pythagorean triple where \(a\) and \(b\) differ by 1, there is a square triangle.

For a slightly different approach to this topic see this article.