# How could I prove this?

I've kind of fallen behind in my Algebra class and I really haven't read much about the theory. I'm wondering, how would you go on about proving that if an odd prime, p, does not divide a nor b, but divides the sum of their squares - a^2 + b^2 -, then p = 1 mod 4.

Up to know, I've been considering the special case in which gcd(a,b) = 1. Of course solving for this case solves for the entire problem; also it leaves something to work with since a^2 + b^2 = a + b mod 3 and a^2 + b^2 = 1 mod 4 or a^2 + b^2 = 2 mod 4. From that point all I tried seemingly led to a dead end. Maybe there is a property or something of the kind that I am not aware of and without which the problem becomes very cumbersome?

Last edited:

## Answers and Replies

morphism
Science Advisor
Homework Helper
Do you know anything about the ring of Gaussian integers Z?

Nope. Like I said I'm quite weak with the theory right now as I've allowed myself to slip behind. Could you give me some details on this ring so I can read about it?

morphism
Science Advisor
Homework Helper
Z = {a+bi : a,b in Z}. Addition and multiplication done like in C turn it into a ring.

Like in Z, there is a notion of "prime number" in Z. The fact I want to exploit is that if p is a prime in Z, and p=3 (mod 4), then p is also a prime in Z (i.e. a Gaussian prime). So maybe you can read up on Gaussian primes.

After that, if we suppose p = 3 (mod 4) in your problem, then p|(a^2+b^2)=(a+bi)(a-bi) would imply that p|(a+bi) or p|(a-bi), which would lead to a contradiction. So p must be = 1 (mod 4).

But there are probably more elementary ways to do this. Number theory isn't my strong suit.

Hummm I don't believe we've gone into such theory quite yet. There must be a more elementary way like you said...

There is no really easy way on that problem, if what you mean is that p = sum of two squares (in only one way). It was stated by Fermat in 1640 and not proven until 1747 by Euler. 1770 proven by Lagrange. 1887 by Dedikand using Gaussian integers. Wikepedia.

However, it is much easier if you only want an X and Y such that X^2+Y^2 ==0 Mod p, because in that case you only need solve $$\frac{X^2}{Y^2}\equiv -1 Mod p$$

Last edited:
morphism
Science Advisor
Homework Helper
Isn't the result you're talking about more general, though? That is, it states those primes that are expressible as a sum of two squares are precisely those that are congruent to 1 mod 4 (with the trivial exception of p=2).

Here we only have that p divides a^2 + b^2, and not that it equals it.

morphism: Here we only have that p divides a^2 + b^2, and not that it equals it.

Yes, that is true. By the time I recognized that and got around to it, you were ahead of me. We only need solve: $$\frac{X^2}{Y^2}\equiv -1 Mod p$$

Last edited:
morphism
Science Advisor
Homework Helper
$$\frac{X^2}{Y^2}\equiv -1 Mod p$$
Ah, that's nice. I should have seen it!