Homepage Solution manuals Ivan Niven An Introduction to the Theory of Numbers Exercise 7.3.6 (Hermite's method for Fermat's theorem on sums of two squares)

Exercise 7.3.6 (Hermite's method for Fermat's theorem on sums of two squares)

Let p be a prime number, p 1 ( mod 4 ) , and suppose that u 2 1 ( mod p ) . (A quick method for finding such a u is described in Section 2.9., in the remarks preceding Theorem 2.45.) Write u p = a 0 , a 1 , , a n , and let i be the largest integer such that k i p . Show that | h i k i u p | < 1 ( k i p ) , and hence that | h i p u k i | < p . Put x = k i , y = h i p u k i . Show that 0 < x 2 + y 2 < 2 p , and that x 2 + y 2 0 ( mod p ) . Deduce that x 2 + y 2 = p .

Answers

Proof. We suppose that p 1 ( mod 4 ) . Then ( 1 p ) = ( 1 ) ( p 1 ) 2 = 1 , so there exists some integer u such that u 2 1 ( mod p ) .

Write u p = a 0 , a 1 , , a n . Since k 0 = 1 p , there exists a largest integer i [ [ 0 , n ] ] such that k i p . Since the sequence ( k i ) 0 i n is increasing, this means that

{ k n p  if  i = n k i p < k i + 1  if  0 i n 1 . (1)

By Problem 5,

| h j k j u p | 1 k j k j + 1  if  0 j < n 1 . (2)
  • If i = n ,

    | h i k i u p | = | h n k n u p | = 0 < 1 k i p .
  • If 0 i n 1 , then

    | h i k i u p | 1 k i k i + 1 ( by (2) ) < 1 k i p ( by (1) ) .

In either case,

| h i k i u p | < 1 k i p ,

hence

| h i p u k i | < p . (3)

Put x = k i , y = h i p u k i . Then x = k i k 1 = 1 , thus x 2 + y 2 > 0 , and by (1) and (3),

x 2 + y 2 = k i 2 + ( h i p u k i ) 2 < 2 p .

So

0 < x 2 + y 2 < 2 p .

Moreover

x 2 + y 2 ( 1 + u 2 ) k i 2 0 ( mod p ) ,

since u 2 + 1 0 ( mod p ) .

The only multiple m of p such that 0 < m < 2 p is p , so

x 2 + y 2 = p .

This gives another proof of Fermat’s theorem on sums of two squares, and one more fast algorithm to find x , y such that x 2 + y 2 = p (if p 1 ( mod 4 ) ). □

User profile picture
2025-07-26 10:55
Comments