Number Theory with Pythagorean Triples For $n\ge3$ a given integer, find a Pythagorean Triple having n as one of its members.
Hint: For n an odd integer, consider the triple $$\left(n, \frac 12\left(n^2-1\right), \frac 12(n^2+1)\right);$$ For n even, consider the triple $$\left(n, \left(\frac{n^2}{4}\right)-1, \left(\frac{n^2}{4}\right)+1 \right)$$
I have been trying to solve this problem by letting $n=x-y$ or $n=2xy$ but have been unable to use the hints properly.  Do I just add the squares of the first 2 and see if it equals the square of the last?  I am just missing the concept here.  Any suggestions would be appreciated.
$$n^2+\left(\frac{n^2-1}{2}\right)^2=n^2+\frac{n^4-2n^2+1}{4}=\frac{n^4+2n^2+1}{4}$$
$$\left( \frac{n^2+1}{2}\right)^2=\frac{n^4+2n+1}{4}$$
Is this all I have to do for odd?
 A: You do want to add the squares of the first two and see if it equals the square of the last.
You also have to make sure all three numbers are integers, which is why you need to do something different depending on whether $n$ is even or odd.
A: $\\ \textbf{Matching sides using Euclid's F(m,n)}: $ Solving for $n$, any values of $m$ that yield integers provide the $F(m,n)$ to identify a triple. Examples follow the solutions
$$\mathbf{A=m^2-n^2\Rightarrow n=\sqrt{m^2-A}\qquad\qquad  \lceil\sqrt{A+1}\rceil \le m \le \biggl\lceil\frac{A}{2}\biggr\rceil}$$
The lower limit ensures $m^2>A$ and the upper limit ensures $m-n\ge 1$.
$$\text{Example:}\qquad  A=21\Rightarrow \lceil\sqrt{21+1}=5 \le m \le \biggl\lceil\frac{21}{2}\biggr\rceil =11\quad and \quad m\in\{5,11\}\Rightarrow n\in\{2,10\} $$
$F(5,2)=(21,20,29)\qquad\qquad F(11,10)=(21,220,221)\\ $
$$\mathbf{B=2mn\Rightarrow n=\frac{B}{2m}\qquad\qquad \bigl\lceil\sqrt{B}\bigr\rceil\le m \le \frac{B}{2}}$$
The lower limit ensures $m>n$ and the upper limit ensures $m-n\ge 1$.
$$\text{Example:}\qquad  B=44\Rightarrow \lceil\sqrt{88}\rceil =10 \le m \le \frac{44}{2}=22\quad and \quad m\in\{11,22\}\Rightarrow n\in\{2,1\}$$
$F(11,2)=(117,44,125)\qquad\qquad F(22,1)=(483,44,485)\\$
$$\mathbf{C=m^2+n^2\Rightarrow n=\sqrt{C-m^2}\qquad\qquad \biggl\lceil\sqrt{\frac{C}{2}}\biggr\rceil \le m < \sqrt{C}}$$
$$\text{Example:}\qquad  C=1105\Rightarrow \biggl\lfloor\sqrt{\frac{1105}{2}}\biggr\rfloor=23 \le m < \lfloor\sqrt{1105}=33\quad and \quad m\in\{24,31,32,33\}\Rightarrow n\in\{23,12,9,4\}\\$$
$F(24,23)=(47,1104,1105)\quad F(31,12)=(817,744,1105)\\ $
$F(32,9)=(943,576,1105)\quad F(33,4)=(1073,264,1105)\\$
