Why is leg of the pythagorean triangle which is of the form qp^3 or 16p where q & p are odd has exactly 10 solutions? The question is in the name. So for example the number 48 which is of the form $q * p^3$ can be the leg of exactly 10 Pythagorean triangles. Why is that? I saw it in a text on number theory and I've been trying to figure it out. I know that the formulas to generate a Pythagorean triplet are $k*(m^2 - n^2)$, $k*(2mn)$ and $k*(m^2 + n^2)$. That means that (considering only primitive triangles, K = 1),
$m^2-n^2 = q*p^3$ ...(1)
$(m-n)(m+n) = q*p^3$...(2)
which means we have to find two odd numbers 'a' and 'b' that fit into the equation. But qp^3 has only (1+1)(3+1) = 8 divisors and not 10(I'm assuming the divisors are the ordered pairs $1 * qp^3$, $q * p^3$, $qp * p^2$, $qp^2 * p$ so there are 8 in total since it can go both ways). So why does it work (or not)?
Edit : absolutely forgot to mention, but q and p are odd primes
 A: Here is a partial answer for the specific case of $qp^3$ when $q,p$ are odd primes:
If $d$ is a factor of an odd square number $m^2$, then a series of $d$ odd numbers centered on $\frac{m^2}{d}$ will sum to $m^2$, because the average value of the numbers in the series is $\frac{m^2}{d}$ and there are $d$ such numbers. Moreover, since the sum of the first $k$ odd numbers is $k^2$, the series sum will be the difference of two squares: The larger square being the square of the largest member of the series, and the smaller square being the square of the odd number next smaller than the smallest member of the series. However, if $d\ge \frac{m^2}{d}$, then the series of odd numbers will contain negative members, and that relationship breaks down; so we exclude such cases.
A side of measure $qp^3$ will have a square of $q^2p^6$, which has $(2+1)(6+1)=21$ distinct divisors. One of those divisors is $qp^3$ itself, and the other $20$ comprise pairs whose product is $q^2p^6$. So $10$ of the divisors will be $<qp^3$, and will give rise to $10$ distinct series of odd numbers containing $d_i$ members, where $1\le i \le 10$, centered on $\frac{q^2p^6}{d_i}$. Each distinct series will be the difference of two squares, and since the series have distinct start and endpoints, the sets of squares giving rise to the difference $q^2p^6$ will also be distinct.
