I was stuck at this question:

Suppose $a^2+b^2=c^2$ for $a,b,c \in \mathbb Z$, and neither $a$ nor $b$ is a multiple of 7. Show that $a^2-b^2$ is a multiple of 7

I tried to write $b^2$ as $c^2-a^2$ then get $a^2-b^2=2a^2-c^2$. But this does not seem to generate the solution.

How to solve problems like this, am I missing some theorems concerning Pythagoras numbers?

  • 6
    $\begingroup$ Hint: What are the possible remainders when you divide a square number by $7$? This is like knowing that the squares in decimal can end with $0,1,4,5,6,9$ but not $2,3,7,8$. For more information on the ideas involved research quadratic residues. $\endgroup$ Aug 2, 2015 at 11:03

2 Answers 2



If $n\equiv0,\pm1,\pm2,\pm3;n^2\equiv0,1,4,2\pmod7$

So, $a^2,b^2\equiv1,2,4$

Check for $c^2\pmod7$ when $a^2\not\equiv b^2\pmod7$

But my greater concern is how the problem, specifically $\pmod7$ was conceived!


Using Euclid's formula, $a=2mn, b=m^2-n^2$

We have $7\nmid2mn(m^2-n^2)$

Now, $(m^2-n^2)^2-(2mn)^2=m^4+n^4-6m^2n^2\equiv m^4+n^4+m^2n^2\pmod7$

But $(m^2-n^2)(m^4+n^4+m^2n^2)=(m^2)^3-(n^2)^3\equiv1-1\pmod7$ using Fermat's Little Theorem as $(m,7)=(n,7)=1$

$\implies7|(m^4+n^4+m^2n^2)$ as $7\nmid(m^2-n^2)$

Can you take it from here?

  • $\begingroup$ I feel it difficult for myself to devise this method, to be honest. Does Dickson's method cover all the numbers which are of Pythagoras relation? $\endgroup$
    – Rescy_
    Aug 2, 2015 at 11:39
  • $\begingroup$ Could you share the motivation for this method? $\endgroup$
    – Rescy_
    Aug 2, 2015 at 11:40
  • $\begingroup$ @Rescy_, This was inspired by the idea of Modular Arithmetic and please go through the updated link :"generating all primitive triples" WLOG $(a,b)=1$ $\endgroup$ Aug 2, 2015 at 14:01
  • $\begingroup$ I don’t see where the question says the triple is primitive, so I would expect additional factors on the first line. But I believe they can be omitted from the second line and the rest proceeds as shown. $\endgroup$
    – David K
    Jul 1, 2019 at 19:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .