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

In summary: 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.In summary, any prime number p that is congruent to 1 modulo 4 can be expressed as the sum of two squares. There is only one pair of integers a and b (with a>b) that satisfies this equation.
  • #1
lifom
14
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
  • #2
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.
 
  • #3
The following is what ramsey2879 might have had in mind:

The ring R = {a + bi : a and b are integers} (where i = [itex]\sqrt{-1}[/itex]) 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 [itex]p = a^2 + b^2[/itex] for integers a and b, then a + bi and a - bi are primes in R. If there were integers c and d such that [itex]p = c^2 + d^2[/itex], 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.
 
  • #4
Petek said:
The following is what ramsey2879 might have had in mind:

The ring R = {a + bi : a and b are integers} (where i = [itex]\sqrt{-1}[/itex]) 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 [itex]p = a^2 + b^2[/itex] for integers a and b, then a + bi and a - bi are primes in R. If there were integers c and d such that [itex]p = c^2 + d^2[/itex], 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?
 
  • #5
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:

[tex](x^2 + y^2)(u^2 + v^2) = (xu\ \pm \ yv)^2 + (xv \ \mp \ yu)^2[/tex]
 
  • #6
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:

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

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?
 
  • #7
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: 532
Last edited by a moderator:
  • #8
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."
 

1. What is the definition of a prime number (= 1 mod 4)?

A prime number (= 1 mod 4) is a positive integer that leaves a remainder of 1 when divided by 4. In other words, it can be written as 4n + 1, where n is a non-negative integer.

2. How many ways can a prime number (= 1 mod 4) be expressed as the sum of 2 squares?

There are infinitely many ways to express a prime number (= 1 mod 4) as the sum of 2 squares. This is known as Fermat's theorem on sums of two squares.

3. What is the significance of expressing a prime number (= 1 mod 4) as the sum of 2 squares?

Expressing a prime number (= 1 mod 4) as the sum of 2 squares is important in number theory and has connections to other mathematical concepts such as Gaussian integers and quadratic reciprocity. It also has practical applications in cryptography and coding theory.

4. Is there a formula for finding all the ways to express a prime number (= 1 mod 4) as the sum of 2 squares?

Yes, there is a formula known as the Brahmagupta-Fibonacci identity that can be used to find all the ways to express a prime number (= 1 mod 4) as the sum of 2 squares. However, it is not a straightforward or simple formula and requires some mathematical manipulation.

5. Can a composite number be expressed as the sum of 2 squares in the same way as a prime number (= 1 mod 4)?

No, composite numbers cannot be expressed as the sum of 2 squares in the same way as a prime number (= 1 mod 4). In fact, there are infinitely many composite numbers that cannot be expressed as the sum of 2 squares at all. This is known as Fermat's theorem on sums of two squares for composite numbers.

Similar threads

  • Linear and Abstract Algebra
Replies
2
Views
798
  • Precalculus Mathematics Homework Help
Replies
17
Views
2K
  • Linear and Abstract Algebra
Replies
2
Views
1K
Replies
7
Views
827
  • Precalculus Mathematics Homework Help
Replies
4
Views
1K
  • Linear and Abstract Algebra
Replies
2
Views
954
  • Linear and Abstract Algebra
Replies
8
Views
2K
Replies
1
Views
760
  • Linear and Abstract Algebra
Replies
1
Views
915
Replies
22
Views
1K
Back
Top