# In how many primitive pythagorean triples can some odd integer $a$ be a non-hypoteneuse edge?

In how many primitive pythagorean triples can some odd, positive integer $a$ be a non-hypoteneuse edge?

In the footnote to this question Daniel Fischer does most of the work:

Let $a$ be the odd integer in the primitive triple satisfying $a^2+b^2=c^2$. Then a common divisor of $c-b$ and $c+b$ would also divide $2c$ and $2b$.

If $a$ is odd then $c-b$ and $c+b$ must also be odd, so $\gcd(c-b,c+b) > = \gcd(b,c)$. Therefore the primitive triples containing $a$ as an odd leg are in bijection with the factorisations of $a^2$ into two coprime factors.

If the factors are to be coprime then every set of similar primes must be collected into a single factor, therefore only the number of distinct prime factors in $a$ controls the enumeration.

Therefore I think if we let $p$ be the number of distinct prime factors of $a$ and if $f(p,2)$ counts the number of ways to partition $p$ elements into two sets, then $f(p,2)$ enumerates the primitive triples in which some odd number $a$ is a non-hypoteneuse edge.

Is this correct, and what is the value of $f(p,2)$?

I think we can send each distinct prime to either the first factor or the second, giving us $2^p$ possibilities. However since $f_1\times f_2=f_2\times f_1$ only half of the solutions are distinct so the solution is $2^{p-1}$

Is that correct?