Formulas for calculating pythagorean triples I'm looking for formulas or methods to find pythagorean triples. I only know one formula for calculating a pythagorean triple and that is euclid's which is:

$$\begin{align}
&amp;a = m^2-n^2 \\
&amp;b = 2mn\\
&amp;c = m^2+n^2 
\end{align}$$

With numerous parameters.

So are there other formulas/methods?
It doesn't seem cumbersome to me.  Just loop on $m$ starting at $2$.  Loop on $n$ starting at $1$ or $2$ depending on the parity of $m$ and going up to $m-1$.  Check the GCD using Euclid's algorithm.  If it is $1$ you have a primitive set, so calculate $a,b,c$.  If you want all sets up to some $N$, multiply $a,b,c$ by all values up to $\lfloor \frac Nc \rfloor$.  Stop the $m$ loop at $\sqrt N$
I can tell formula for any odd number but this formula always works. 

take any odd number=(x) . Solve for $(a+a+1 = x^2)$.

$(a)$ and $(a+1)$ will be the two numbers that will satisfy pythagoran triplet with $x$.

$(x)$ should be a natural number.

$(a+1)$ will be hypotenuse, $(a)$ will be the longer side ( if you consider perpendicular is greater, then $(a)$ is the perpendicular) and $(x)$ will be the shortest side.

This is the new trick which is invented by me shreyas.