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, $\left({n, n+1}\right)$ form the generator for the primitive Pythagorean triple $\left({2 m n, m^2 - n^2, m^2 + n^2}\right)$ where $m = n + 1$.

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

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

Then:

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

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