How to compute the Pythagorean triple by one of the numbers that belonged to it? I have a positive number $n>2$. How to compute the Pythagorean triple containing $n$? $n$ may be the hypotenuse and leg.
 A: So thanks to @Henning Makholm, I realized that it does hold for every integer $n >2$.
Case 1. Suppose $n$ is an odd integer, say $n=2k+1$. ($k\geq1$)
\begin{align*}
n&=2k+1\\
c&=2k^2+2k+1\\
b&=2k^2+2k\\
c^2&=b^2+n^2
\end{align*}
Case 2. Suppose $n$ is two times an odd integer, say $n=4k+2$.($k\geq1$)
\begin{align*}
n&=4k+2\\
c&=4k^2+4k+2\\
b&=4k^2+4k\\
c^2&=b^2+n^2
\end{align*}
Case 3. If $n$ is an arbitrary even number then you can write is as $n=2^\alpha t$, where $t$ is an odd number. If $\alpha$ is odd you can use Case 2 to generate $b,c$, otherwise you can use Case 1.
A: The following is for finding primitive Pythagorean triples. A Pythagorean triple $(a,b,c)$ is primitive if the numbers $a$, $b$ and $c$ are coprime.


If $n$ is a leg, then it must be odd, or a multiple of $4$ (and greater than $1$).
If it is odd, write $n$ as the product of two coprime integers: $n=ab$, $a<b$. Then solve the system
  $$\left\{\begin{array}{rcl}u-v&=&a\\u+v&=&b\end{array}\right.$$ The
  other leg is $2uv$.
If $n$ is even, write it as $n=2uv$, where $u$ and $v$ are coprime and have different parity. The other leg is $u^2-v^2$.
If $n$ is the hypothenuse, every prime factor of $n$ must be of the form $4k+1$. If this holds, the easiest way to proceed
  is finding by brute force two coprime squares whose sum is $n$. A well known theorem guarantees that they must exist. Say
  $u^2+v^2=n$. Then the legs are $u^2-v^2$ and $2uv$.
There are more advanced ways to find this sum of squares, but they
  involve prime factorization in $\Bbb Z[i]$.


To find other Pythagorean triples (that is, non primitive), look for a factor of $n$ that satisfies the above specified properties, say $m$. Then $n=km$. Then, do the same procedure with $m$, so you obtain a primitive Pythagorean triple that contains $m$. Multiply these three numbers by $k$ and you are done.
A: If $a$ is the smallest leg then you can find others in very simple way-
If $a$ is odd then -
$$b = \dfrac{n^2-1}{2};\; c = \dfrac{n^2+1}{2}\\ 
[\dfrac{n^2-1}{2}]^2 + n^2 = [\dfrac{n^2+1}{2}]^2$$
If $a$ is even then -
$$b = \dfrac{n^2}{4}-1;\; c = \dfrac{n^2}{4}+1\\ 
[\dfrac{n^2}{4}-1]^2 + n^2 = [\dfrac{n^2}{4}+1]^2$$   
A: Using Euclid's formula, we can find triples matching any hypotenuse by solving the C-function for k and seeing which of a range of m-values yield integers. The limitation is that, for primitive triples, C must take the form $C-4n+1$ and not all of these are valid. Some valid ones are $5,13,17,25,29,37,41 ... 65$
\begin{equation}
C=m^2+k^2\implies k=\sqrt{C-m^2}\qquad\text{for}\qquad \bigg\lfloor\frac{ 1+\sqrt{2C-1}}{2}\bigg\rfloor \le m \le \lfloor\sqrt{C-1}\rfloor
\end{equation}
The lower limit ensures $m>k$ and the upper limit ensures $k\in\mathbb{N}$.
$$C=65\implies \bigg\lfloor\frac{ 1+\sqrt{130-1}}{2}\bigg\rfloor=6 \le m \le \lfloor\sqrt{65-1}\rfloor=8\quad\land \quad m\in\{7,8\}\Rightarrow k\in\{4,1\}\\$$
$$F(7,4)=(33,56,65)\qquad \qquad F(8,1)=(63,16,65) $$
There is a side-A matching every odd number greater that one.
\begin{equation}
A=m^2-k^2\implies k=\sqrt{m^2-A}\qquad\text{for}\qquad  \sqrt{A+1} \le m \le \frac{A+1}{2}
\end{equation}
The lower limit ensures $k\in\mathbb{N}$ and the upper limit ensures $m> k$.
$$A=15\implies \sqrt{15+1}=4\le m \le \frac{15+1}{2} =8\quad\land\quad m\in\{4,8\}\implies k \in\{1,7\} $$
$$F(4,1)=(15,8,17)\qquad \qquad F(8,7)=(15,112,113) $$
There is a side-B for every multiple of four.
\begin{equation}
B=2mk\implies k=\frac{B}{2m}\qquad\text{for}\qquad \bigg\lfloor \frac{1+\sqrt{2B+1}}{2}\bigg\rfloor \le m \le \frac{B}{2}
\end{equation}
The lower limit ensures $m>k$ and the upper limit ensures $m\ge 2$
$$B=44\implies\qquad \bigg\lfloor \frac{1+\sqrt{88+1}}{2}\bigg\rfloor =5 \le m \le \frac{44}{2}=22\quad \land \quad m\in\{11,22\}\implies k\in\{2,1\}$$
$$F(11,2)=(117,44,125)\qquad\qquad F(22,1)=(483,44,485)$$
