Homepage › Solution manuals › Ivan Niven › An Introduction to the Theory of Numbers › Exercise 3.7.4 (Number of representations of $n$ by $x^2 + xy + y^2$)
Exercise 3.7.4 (Number of representations of $n$ by $x^2 + xy + y^2$)
Write the canonical factorization of in the form where the primes are of the form and the primes are of the form . Show that is represented by if and only if all the are even. Show that for such , (*).
(*)The typo is corrected (R.G.).
Answers
Proof. We write the factorization of the integer in prime factors in the form
where the primes are of the form , and the primes are of the form , and for all , for all (note that if is even).
- (a)
-
Suppose that
is represented by the form
, so that
for some integers
. Let
be a prime of the form
.
Suppose that . Then , so , where .
If is even, then and are even.
If and , write an inverse of modulo , so that . Then (where ), thus , therefore , which contradicts . This contradiction shows that , and since , we have also . Since and , where , we obtain and .
We have proved that every prime of the form (including ) which divides satisfies and (this is similar to Lemma 2.14).
Let be a divisor of of the form . Suppose, for the sake of contradiction, that is odd, so that for some integer .
Reasoning by induction, suppose that and for some . Then , and
Since , , and the same reasoning shows that , so that and .
The induction is done, which proves that and , thus . This is a contradiction since , so .
Therefore is even for all .
Conversely, suppose that is even for every . We obtain a composition of the form with itself by the following method. Let , which satisfies , and , thus . Then , and for all integers ,
This gives the composition formula
For instance .
This shows that if and are represented by , then is also represented by . First is represented by . Every , of the form is (properly) represented by by Problem 3. If is of the form , then is represented by .
Since is even for all , is a product of integers represented by , so is represented by .
In conclusion, is represented by if and only if is even for every .
- (b)
-
We suppose now that this condition is satisfied, so that
.
For every positive integer , let denote the number of distinct primes that divide .
By Theorem 3.27,
and by Problem 3,
where } for every positive integer (in particular, ).
Put , and , so that
Suppose that , where . Then the map
is bijective, because .
We prove now that is a multiplicative function.
-
If is odd, then are odd. Then, using ,
-
If is even, then one of the two factors or is even, say , and the other is odd, so
where are odd, and .
Since the congruence has no solution, if , thus for every positive integer .
-
If is even, then the first sum is
Thus , and similarly . Therefore
-
If is odd,
Thus , and similarly , so .
-
In all cases,
Since is a multiplicative function, for , we obtain
We evaluate the values for the three types of prime numbers in this formula.
-
If , and if , because implies , so for some integer , and , where , thus . This is impossible, thus for . This gives
In both cases,
-
If , then , so the congruence has two solutions, thus . By Hensel’s Lemma, for (and ).
Here is an odd prime, so
Since and , we obtain
In both cases,
-
If , then , thus so the congruence has no solution, a fortiori has no solution. Therefore , and if . Then
-
If ,
By hypothesis, is even, thus
-
If , we have already proven that if , and . Then
Since is even by hypothesis, we obtain the same results than in the case odd: for all , including ,
-
With these results, equation (1) gives for ,
-
Phew! □
Note: I mimicked the proofs of N.Z.M. given in the case of sum of two squares. Using the decomposition of in prime factors in the Principal Ideal Domain ( ), there must be a shorter proof of this last result.
Some code in Sage to check the preceding results on the functions and :
def N(m):
counter = 0
for u in range(m):
if u^2 % m == (-3) % m:
counter += 1
return counter
def g(n):
d = 1
som = 0
while d^2 <= n:
if n % (d^2) == 0:
q = n // d^2
som += N(4*q)
d += 1
assert som % 2 == 0
return som // 2
[N(3^k) for k in range(7)]
[1, 1, 0, 0, 0, 0, 0]
[g(3^k) for k in range(7)]
[1, 1, 1, 1, 1, 1, 1]
[N(7^k) for k in range(7)]
[1, 2, 2, 2, 2, 2, 2]
[g(7^k) for k in range(7)]
[1, 2, 3, 4, 5, 6, 7]
[N(11^k) for k in range(7)]
[1, 0, 0, 0, 0, 0, 0]
[g(11^k) for k in range(7)]
[1, 0, 1, 0, 1, 0, 1]
[N(2^k) for k in range(7)]
[1, 1, 2, 0, 0, 0, 0]
[g(2^k) for k in range(7)]
[1, 0, 1, 0, 1, 0, 1]
We can also verify that is a multiplicative function:
for x in range(1,101): for y in range(1,101): if gcd(x, y) == 1: if g(x * y) != g(x)* g(y): print(’There is something wrong in the Kingdom’)