The effect of scalars on primitive Pythagorean triples When some scalars are applied to primitive Pythagorean triples, the triple can still be expressed in terms of m and n with
x=m^2-n^2
y=2mn
z=m^2+n^2
but with others it changes it. So far I've found that using 2,4,8 and 9 doesn't affect it, and 3,5,6,7,11 do. I'm assuming there's a pattern, because, well, it's maths, so there's always a pattern, but I can't see it.
Can anyone explain it please?
 A: The formula for a primitive Pythagorean triangle is:
$$ x = m^2-n^2 \\ y = 2mn \\ z = m^2+n^2$$
where $m$ and $n$ are co-prime, and not both odd.
If you disregard the conditions on $m$ and $n$, you can get non-primitive triangles. Let's violate the first condition, making $m$ and $n$ not co-prime, e.g. they have a factor $k$ in common. Let $m=kr$ and $n=ks$. Then we get:
$$ x = (kr)^2-(ks)^2 = k^2(r^2-s^2)  \\ y = 2(kr)(ks)=k^2 2rs \\ z = (kr)^2+(ks)^2 = k^2(r^2+s^2)$$
Here we have a factor $k^2$ times a Pythagorean triple that uses $(r,s)$ as its parameters instead of $(m,n)$.
Suppose we violate the other condition, by making $m$ and $n$ both odd, i.e. $m=2a+1$ and $n=2b+1$ for some integers $a$ and $b$. Substituting this we get:
$$ x = (2a+1)^2-(2b+1)^2 = 2*2(a+b+1)(a-b) \\ y = 2(2a+1)(2b+1) = 2(a+b+1)^2-2(a-b)^2\\ z = (2a+1)^2+(2b+1)^2 = 2(a+b+1)^2+2(a-b)^2$$
Here we have a factor $2$ times a Pythagorean triple that uses $(a+b+1,a-b)$ as its parameters instead of $(m,n)$.
Conversely, if we scale a primitive Pythagorean triangle by $2$, or by a square $k^2$, or both (i.e. by $2k^2$), then that triangle can be rewritten in the form of a primitive Pythagorean triangle, except that it violates one or both the conditions on its parameters.
A: You can always multiply by any square.  If you have a solution $(x,y,z)$ that you can express with $m,n$, you can express $(a^2x,a^2y,a^2z)$ using $(am,an)$.  
You can multiply by $2$.  If you have a solution $(x,y,z)$ that you can express with $m,n$ you can express $(2x,2y,2z)$ with $2z=(m+n)^2+(m-n)^2,2y=(m+n)^2-(m-n)^2,2x=2(m+n)(m-n)$  
You can compound these so $a$ can be any square or twice a square.
Part of your observation is a consequence of Fermat's theorem on the sum of two squares.  If you can find $r,s$ such that $az=r^2+s^2$ you can express $ax,ay$ as required.  As squares are always $0,1 \bmod 4$ you cannot do this if $a\equiv 3 \bmod 4$, explaining your observation that $3,6,7,11$ cause this to fail as they provide a single factor that is equivalent to $3 \bmod 4$.  
I have not shown that you can't multiply by $5$ and get a representation using Eucld's formula. 
