How many ways to express a prime (= 1 mod 4) into sum of 2 squares ?

lifom
Messages
14
Reaction score
0
I know that any prime p = 1 mod 4 can be expressed as sum of 2 squares.
But how many different pairs of integers a,b such that p = a^2+b^2? (with a>b!)
It seems there is only one pair. How to prove it?
I try in this way: assume p = a^2+b^2 = c^2+d^2 (with a>c>d>b) and try to show it has contradiction, but I fail.
 
Physics news on Phys.org
lifom said:
I know that any prime p = 1 mod 4 can be expressed as sum of 2 squares.
But how many different pairs of integers a,b such that p = a^2+b^2? (with a>b!)
It seems there is only one pair. How to prove it?
I try in this way: assume p = a^2+b^2 = c^2+d^2 (with a>c>d>b) and try to show it has contradiction, but I fail.
It is an old and well known proof. I would try and google for it. I believe it may have to do with imaginary integers and factoring the "difference of two squares". I am 65 and its been a long time since I read the proof so I don't remember.
 
The following is what ramsey2879 might have had in mind:

The ring R = {a + bi : a and b are integers} (where i = \sqrt{-1}) can be shown to be a unique factorization domain. It also can be shown that if p is a prime integer congruent to 1 mod 4 and p = a^2 + b^2 for integers a and b, then a + bi and a - bi are primes in R. If there were integers c and d such that p = c^2 + d^2, then we would have (a + bi)(a - bi) = (c + di)(c - di). By unique factorization in R, the factors c + di and c - di must be the same as a + bi and a - bi, up to multiplication by units. Since the units in R are 1, -1, i and -i, it follows that the integers a and b are the same as the integers c and d. The ring R is usually called the Gaussian integers.
 
Petek said:
The following is what ramsey2879 might have had in mind:

The ring R = {a + bi : a and b are integers} (where i = \sqrt{-1}) can be shown to be a unique factorization domain. It also can be shown that if p is a prime integer congruent to 1 mod 4 and p = a^2 + b^2 for integers a and b, then a + bi and a - bi are primes in R. If there were integers c and d such that p = c^2 + d^2, then we would have (a + bi)(a - bi) = (c + di)(c - di). By unique factorization in R, the factors c + di and c - di must be the same as a + bi and a - bi, up to multiplication by units. Since the units in R are 1, -1, i and -i, it follows that the integers a and b are the same as the integers c and d. The ring R is usually called the Gaussian integers.

Thanks, But I haven't learned ring yet. So would you mind to suggest a eaiser proof?
 
Hmm ... . That's the only proof I know right off the top of my head. Is this an exercise from a book? If so, which section is it in? Is there a hint? Are there any theorems in the section that might be relevant? Do you know this formula:

(x^2 + y^2)(u^2 + v^2) = (xu\ \pm \ yv)^2 + (xv \ \mp \ yu)^2
 
Petek said:
Hmm ... . That's the only proof I know right off the top of my head. Is this an exercise from a book? If so, which section is it in? Is there a hint? Are there any theorems in the section that might be relevant? Do you know this formula:

(x^2 + y^2)(u^2 + v^2) = (xu\ \pm \ yv)^2 + (xv \ \mp \ yu)^2

Many thanks. I have found another proof on the web.
May I ask the generalization: Let S(m) be the number of ways to express m = a^2+b^2, a>=b.
S(p) = 1 if p = prime = 1 mod 4 (proved)
S(p) = 0 if p = prime = 3 mod 4 (proved)
S(pq) = 2 if p,q are distinct prime = 1mod 4 (proved)
S(p_1p_2...p_r) = 2^(r-1) if all distinct prime = 1 mod 4 (how to prove?)
I have use Mathematical Induction, but can't handle the induction steps...
Let p_1p_2...p_r = (a_i)^2+(b_i)^2 for i = 1,2,...,2^(r-1)
and let p_(r+1) = A^2+B^2.
Then p_1p_2...p_rp_(r+1)=((a_i)^2+(b_i)^2)(A^2+B^2)=...
I can show that ((a_i)^2+(b_i)^2)(A^2+B^2) can form 2 different sums of squares, but I can't show why ((a_i)^2+(b_i)^2)(A^2+B^2) are all different for each i...
Any suggestions?
 
lifom said:
I know that any prime p = 1 mod 4 can be expressed as sum of 2 squares.
But how many different pairs of integers a,b such that p = a^2+b^2? (with a>b!)
It seems there is only one pair. How to prove it?
I try in this way: assume p = a^2+b^2 = c^2+d^2 (with a>c>d>b) and try to show it has contradiction, but I fail.

This page also shows how to calculate the two squares. (only using GCD algoritm over complex numbers).

http://wims.unice.fr/wims/wims.cgi?session=G541DFD6A1.2&+lang=en&+module=tool%2Fnumber%2Ftwosquares.en&+cmd=help&+special_parm=
 

Attachments

  • squares.GIF
    squares.GIF
    47.8 KB · Views: 574
Last edited by a moderator:
This is a famous problem and not an easy one. Euler first proved it. I quote from Wikipedia: "Fermat's theorem on sums of two squares asserts that an odd prime number p can be expressed as
p = x2 + y2
with integer x and y if and only if p is congruent to 1 (mod 4). The statement was announced by Fermat in 1640, but he supplied no proof.
The "only if" clause is easy: a perfect square is congruent to 0 or 1 modulo 4, hence a sum of two squares is congruent to 0, 1, or 2. An odd prime number is congruent to either 1 or 3 modulo 4, and the second possibility has just been ruled out. The first proof that such a representation exists was given by Leonhard Euler in 1747 and was quite complicated. Since then, many different proofs have been found. Among them, the proof using Minkowski's theorem about convex sets[1] and Don Zagier's stunningly short proof based on involutions especially stand out."
 
Back
Top