Homepage › Solution manuals › Ivan Niven › An Introduction to the Theory of Numbers › Exercise 3.6.5 (Number of ordered pairs $(x,y)$ of positive integers for which $x^2 + y^2 = n$)
Exercise 3.6.5 (Number of ordered pairs $(x,y)$ of positive integers for which $x^2 + y^2 = n$)
Suppose that is not a perfect square. Show that the number of ordered pairs of positive integers for which is . Show that if is a perfect square then the number of such representations of is .
Answers
Proof.
- (a)
-
Let
be a positive integer, and let
be the set of solutions
of
. Put
Since is not a solution,
and this union is a disjoint union, therefore
Moreover, the maps
(rotations of angles , , restricted to and ) satisfy , thus is a bijection, so , and similarly . Therefore
so
Suppose that is not a perfect square. Then there is no solution of such that or , thus
Then the equality (1) shows that
The number of ordered pairs of positive integers for which is .
- (b)
-
Suppose now that
is a perfect square. Then, with the notations of part (a),
Therefore
so
If is a perfect square then the number of ordered pairs of positive integers for which is