# proof: primitive pythagorean triple, a or b has to be divisible by 3

I'm reading "A friendly introduction to number theory" and I'm stuck in this exercise, I'm mentioning this because what I need is a basic answer, all I know about primitive pythagorean triplets is they satisfy $a^2 + b^2 = c^2$ and a, b and c has no common factors.

Now.. my approach (probably kind of silly) was to "classify" the odd numbers (not divisible by 3) as $6k+1$, $6k+2$ and $6k+5$, and the even numbers with $6k+2$ and $6k+4$, then, trying different combinations of that, I could probe all the cases when I assume c is not 3 divisible, but I still have to probe that c cannot be 3 divisible and I don't know how to do it.

Anyway, probably there is a better simpler solution.

(Sorry, if this is a stupid question, I'm trying to teach myself number theory without much math background)

• Actually what was the exercise? Dec 28, 2014 at 17:07
• Note that any square is congruent to $0$ or $1$ modulo $3$. So if neither $a$ nor $b$ is divisible by $3$, then $a^2+b^2\equiv 2\pmod{3}$, which is impossible for a square. Dec 28, 2014 at 17:09
• @supremum: prove that in a pythagorean triple, a or b has to be divisible by 3. Should I put it in the body of the question? I thought it was a bit repetitive but maybe is confusing.
– Hugo
Dec 28, 2014 at 18:38
• @AndréNicolas: thanks! do you want to write that as a answer so I can mark it as accepted?
– Hugo
Dec 28, 2014 at 18:39
• You are welcome. When you find out how to do a problem, it is encouraged that you write it up yourself as an answer. If you have trouble with the LaTeX, just write it up as best you can and if you send me a message I can edit things. You made a good choice of book, Silverman's is well-written. Dec 28, 2014 at 19:01

Any square is congruent to $$0$$ or $$1$$ modulo $$3$$

So having, $$a^2 + b^2 = c^2$$

Let's suppose neither $$a$$ nor $$b$$ is divisible by $$3$$, then, the squares must be $$1$$ modulo $$3$$.

So, the expression can be re-written as:

$$(3k + 1) + (3k' + 1) = c^2$$

and then

$$3 (k + k') + 2 = c^2$$

That is, $$c^2$$ is a square congruent $$2$$ modulo $$3$$, which is absurd.

Edit: maybe I should add that for definition of Pythagorean triple, only one can be divisible by 3, not both.

• The proof above shows that in any Pythagorean triple $(a,b,c)$, we have $3$ divides $a$ or $3$ divides $b$. This "or" as usual includes the possibility of both. For primitive triples, it cannot be both. Dec 28, 2014 at 21:06

\begin{array}{|c|c|} \hline n \pmod 3 & n^2 \pmod 3 \\ \hline 0 & 0 \\ 1 & 1 \\ 2 & 1 \\ \hline \end{array}

If neither $a$ nor $b$ is a multiple of $3$, then $a^2 + b^2 \equiv c^2 \pmod 3$ becomes $1 + 1 \equiv c^2 \pmod 3$, which simplifies to $c^2 \equiv 2 \pmod 3$; which has no solution.

I'm reading the book too. I came up with a different approach. Of course, it is not as elegant as the answer given, but here goes.

$$a = st$$ $$b = (s^2 - t^2)/2$$

Choose values for s and t.

If either of s or t is a multiple of 3, then $a = st$ is a multiple of 3. Both s and t cannot be multiples of 3, as that will cause both a and b to be multiples of 3 and the triplet won't be primitive.

If neither s nor t is a multiple of 3.

$$s = 3x + y$$ $$t = 3p + q$$

Here y and q can take values 1 and 2.

a cannot be a multiple of 3. Simplifying b, we get

$$b = (s - t)(s + t)/2$$ $$b = (3x - 3p + y - q)(3x + 3p + y + q)/2$$

Now y and q can either be 1 or 2.

When y and q are both equal to 1 or 2, the first term becomes $(3x - 3p)$.

When y and q are unequal, but take the values 1 or 2, the second term becomes $(3x + 3p + 3)$.

In both cases, b is a multiple of 3.

• I think there is a little mistake in the first simplified term (but it doesn't affect your conclusion), I think the first term should be (3x - 3p + y - q)
– Hugo
Sep 10, 2015 at 12:26
• @Hugo Aah yes. Thank you. Sep 10, 2015 at 12:28