# 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?

• Welcome to MSE. Please use MathJax. – José Carlos Santos May 22 '18 at 14:46
• Welcome to math stack exchange! What do you mean with scalars ? Multiplying $m$ and $n$ with a fixed positive integer ? This always gives a new pythagorean triple. Please clarify your question. – Peter May 22 '18 at 14:51
• Somewhat off-topic. Even in mathematics, there is not always a pattern. The digits of $\pi$ and the primes apparently do not follow a pattern. – Peter May 22 '18 at 14:53
• Can you provide two examples of the math at the end? There are constraints on m and n in the generating equations; they may not be primitive if they do not satisfy the constraints. – theREALyumdub May 22 '18 at 14:57
• When you say a scalar is applied to a primitive Pythagorean triple it appears you are starting with a primitive triple $(x,y,z)$ and multiplying it by $a$ to get a nonprimitive triple $(ax,ay,az)$, then looking for $r,s$ such that $ax=r^2-s^2,ay=2rs,az=r^2+s^2$ Of course, the new triple will not be primitive. Is that a correct interpretation? – Ross Millikan May 22 '18 at 15:04

## 2 Answers

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.

• This does not answer the question. It justifies the restrictions on $m,n$ to get a primitive triangle but does not address what you can multiply a primitive triangle by and find $m,n$ that satisfy Euclid's formula. – Ross Millikan May 22 '18 at 22:32

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.