Pythagorean Triangle from Sum of Reciprocals of Consecutive Same Parity Integers

Theorem
Let $a, b \in \Z_{>0}$ be (strictly) positive integers such that they are consecutively of the same parity.

Let $\dfrac p q = \dfrac 1 a + \dfrac 1 b$.

Then $p$ and $q$ are the legs of a Pythagorean triangle.

Proof
Let $a$ and $b$ both be even.

Then:

From Solutions of Pythagorean Equation, $\tuple {n, n + 1}$ form the generator for the primitive Pythagorean triple $\tuple {2 m n, m^2 - n^2, m^2 + n^2}$ where $m = n + 1$.

The legs of the resulting primitive Pythagorean triangle are $2 n \paren {n + 1}$ and $\paren {n + 1}^2 - n^2$.

Let $a$ and $b$ both be odd.

Then:

From Solutions of Pythagorean Equation, $\tuple {2 n + 2, 1}$ form the generator for the primitive Pythagorean triple $\tuple {2 m n, m^2 - n^2, m^2 + n^2}$ where $m = 2 n + 2$ and $n = 1$.

The legs of the resulting primitive Pythagorean triangle are $2 \paren {2 n + 2}$ and $\paren {2 n + 2}^2 - 1$.