How to find nonprimitive pythagorean triples given hypotenuse? The integer $2015$ is the largest integer in $4$ different pythagorean triples, none of which is a primitive triple. Can someone explain how to find the $4$ triples?
 A: We can find matching triangles for given hypotenuse, if they exist, $\mathbf{\text{for primitives, doubles, and square multiples of primitives}}$ by solving Euclid's formula function $C=m^2+n^2$ for $n$ in terms of $C$ and $m$, then testing values of $m$ within clearly defined finite limits. For any $m$ that yields a positive integer $n$, we have $(m,n)$ for a Pythagorean triple.
There is no primitive, double, or square multiple triple where $C=2015$ but we can find matches in the factors.
$$\text{For }C= m^2+n^2\qquad n=\sqrt{C-m^2}\text{ where }\biggl\lceil\sqrt{\frac{C}{2}}\space\space\biggr\rceil \le m\le\bigl\lfloor\sqrt{C}\bigr\rfloor$$
$$\text{Given }C=\frac{2015}{31}=65\quad 6\le m \le 8$$
$$f(7,4)\rightarrow (33,56,65)*31=(1023,1736,2015)\\ 
f(8,1)\rightarrow (63,16,65)*31=(1953,496,2015)$$
Given $C=\frac{2015}{403}=5\quad 2\le m \le 2\qquad f(2,1)\rightarrow (3,4,5)*403=(1209,1612,2015)$
$\text{Given }C=\frac{2015}{155}=13\quad 3\le m \le 3\qquad f(3,2)\rightarrow (5,12,13)*155=(2015,4836,5239)$
Given $C=\frac{2015}{65}=31\quad 4\le m \le 5\qquad $ but there are no triples where $C=31$.
Given $C=\frac{2015}{13}=155\quad 9\le m \le 12\qquad $ but there are no triples where $C=155$.
Given $C=\frac{2015}{5}=403\quad 15\le m \le 20\qquad $ but there are no triples where $C=403$.
A: Since they’re not primitive, each of them will have a common factor greater than $1$. Since the prime factorization of $2015$ is $5\cdot13\cdot31$, the possible values of the long side in the primitive triples are $5,13,31,65,155$, and $403$. You can probably already pick out two of the four by eye. If you know that the largest number in a primitive Pythagorean triple is the sum of two squares, you shouldn’t have too much trouble finding the other two. I’ve added an extra hint in the spoiler-protected block below.

 HINT: What is the smallest positive integer that is the sum of two different squares in two different ways?

