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 n in the form n = 3 α p β q γ where the primes p are of the form 3 k + 1 and the primes q are of the form 3 k + 2 . Show that n is represented by f ( x , y ) = x 2 + xy + y 2 if and only if all the γ are even. Show that for such n , R f ( n ) = 6 p ( β + 1 ) (*).

(*)The typo is corrected (R.G.).

Answers

Proof. We write the factorization of the integer n > 1 in prime factors in the form

n = 3 α p A n p β ( p ) q B n q γ ( q ) ,

where the primes p A n are of the form 3 k + 1 , and the primes q B n are of the form 3 k + 2 , and β ( p ) > 0 for all p A , γ ( q ) > 0 for all q B n (note that 2 B n if n is even).

(a)
Suppose that n is represented by the form f ( x , y ) = x 2 + xy + y 2 , so that n = f ( a , b ) = a 2 + ab + b 2 for some integers a , b . Let q be a prime of the form q = 3 k + 2 .

Suppose that q n . Then q 4 n = 4 f ( a , b ) = ( 2 a + b ) 2 + 3 b 2 , so q c 2 + 3 d 2 , where c = 2 a + b , d = b .

If a 2 + ab + b 2 is even, then a and b are even.

If q d and q 2 , write d ¯ an inverse of d modulo q , so that d d ¯ 1 ( mod q ) . Then 3 ( c d ¯ ) 2 ( mod q ) (where q 3 = 1 ), thus ( 3 q ) = ( q 3 ) = 1 , therefore q 1 ( mod 3 ) , which contradicts q 2 ( mod 3 ) . This contradiction shows that q d , and since q c 2 + 3 d 2 , we have also q c . Since q 2 a + b and q b , where q 2 = 1 , we obtain q a and q b .

We have proved that every prime q of the form 3 k + 2 (including q = 2 ) which divides n = a 2 + ab + b 2 satisfies q a and q b (this is similar to Lemma 2.14).

Let q B n be a divisor of n of the form 3 k + 2 . Suppose, for the sake of contradiction, that γ ( q ) is odd, so that γ ( q ) = 2 u + 1 for some integer u .

Reasoning by induction, suppose that q j a and q j b for some j u . Then q 2 j n , and

n q 2 j = ( a q j ) 2 + a q j b q j + ( b q j ) 2 = f ( a q j , b q j ) .

Since 2 j + 1 2 u + 1 = γ ( q ) , q n q 2 j = f ( a q j , b q j ) , and the same reasoning shows that q a q j , q b q j , so that q j + 1 a and q j + 1 b .

The induction is done, which proves that q u + 1 a and q u + 1 b , thus q 2 u + 2 n . This is a contradiction since γ ( q ) = 2 u + 1 , so q 2 u + 2 n .

Therefore γ ( q ) is even for all q B .

Conversely, suppose that γ ( q ) is even for every q B . We obtain a composition of the form f ( x , y ) = x 2 + xy + y 2 with itself by the following method. Let ω = e 2 3 , which satisfies ω 3 = 1 , and ω 1 , thus ω 2 + ω + 1 = 0 . Then f ( a , b ) = a 2 + ab + b 2 = ( a ) ( a b ω 2 ) , and for all integers a , b , c , d ,

f ( a , b ) f ( c , d ) = [ ( a ) ( a b ω 2 ) ] [ ( c ) ( c d ω 2 ) ] = [ ( a ) ( c ) ] [ ( a b ω 2 ) ( c d ω 2 ) ] = ( ac + bd ( ω 1 ) ( bc + ad ) ω ) ( ac + bd ( ω 2 1 ) ( bc + ad ) ω 2 ) = ( ac bd ( bc + ad + bd ) ω ) ( ac bd ( bc + ad + bd ) ω 2 ) = f ( ac bd , bc + ad + bd ) .

This gives the composition formula

f ( a , b ) f ( c , d ) = f ( ac bd , bc + ad + bd ) .

For instance 3 7 = f ( 1 , 1 ) f ( 1 , 2 ) = f ( 1 , 5 ) = ( 1 ) 2 + ( 1 ) 5 + 5 2 .

This shows that if n and m are represented by f , then nm is also represented by f . First 3 = f ( 1 , 1 ) is represented by f . Every p A , of the form p = 3 k + 1 is (properly) represented by f by Problem 3. If q B is of the form q = 3 k + 2 , then q 2 = f ( q , 0 ) is represented by f .

Since γ ( q ) is even for all q B n , n = 3 α p A n p β ( p ) q B n ( q 2 ) γ ( q ) 2 is a product of integers represented by f , so n is represented by f .

In conclusion, n = 3 α p A n p β ( p ) q B n q γ ( q ) is represented by f if and only if γ ( q ) is even for every q B n .

(b)
We suppose now that this condition is satisfied, so that R f ( n ) > 0 .

For every positive integer n = 3 α p A n p β ( p ) q B n q γ ( q ) , let s ( n ) = | A n | denote the number of distinct primes p 1 ( mod 3 ) that divide n .

By Theorem 3.27,

R f ( n ) = d 2 n r f ( n d 2 ) ,

and by Problem 3,

r f ( n ) = 6 1 2 N ( 4 n ) = { 6 2 s ( n ) if  α = 0  or  1 , and  B n =   , 0 otherwise.

where N ( m ) = Card { u [ [ 0 , m [ [ u 2 3 ( mod m ) } for every positive integer m (in particular, N ( 1 ) = 1 ).

Put U n = { d : d 2 n } , and g ( n ) = 1 2 d U n N ( 4 n d 2 ) , so that

R f ( n ) = 6 1 2 d U n N ( 4 n d 2 ) = 6 g ( n ) .

Suppose that n = n 1 n 2 , where n 1 n 2 = 1 . Then the map

φ { U n 1 × U n 2 U n ( d 1 , d 2 ) d 1 d 2

is bijective, because n 1 n 2 = 1 .

We prove now that g is a multiplicative function.

  • If n is odd, then n 1 , n 2 are odd. Then, using N ( 4 ) = 2 ,

    g ( n 1 ) g ( n 2 ) = d 1 U n 1 1 2 N ( 4 n 1 d 1 2 ) d 2 U n 2 1 2 N ( 4 n 2 d 2 2 ) = 1 4 ( d 1 , d 2 ) U n 1 × U n 2 N ( 4 n 1 d 1 2 ) N ( 4 n 2 d 2 2 ) = ( d 1 , d 2 ) U n 1 × U n 2 N ( n 1 d 1 2 ) N ( n 2 d 2 2 ) ( since  4 n i d i 2 = 1 ) = ( d 1 , d 2 ) U n 1 × U n 2 N ( n ( d 1 d 2 ) 2 ) ( since  n 1 d 1 2 n 2 d 2 2 = 1 ) = d U n N ( n d 2 ) ( since  φ  is bijective ) = 1 2 d U n N ( 4 n d 2 ) = g ( n ) .
  • If n is even, then one of the two factors n 1 or n 2 is even, say n 1 , and the other is odd, so

    n = 2 δ n , n 1 = 2 δ n 1 , n 2 = n 2 ,

    where n , n 1 , n 2 are odd, and δ 1 .

    Since the congruence x 2 3 ( mod 8 ) has no solution, N ( 2 k ) = 0 if k 3 , thus N ( 2 k m ) = 0 for every positive integer m .

    g ( n ) = g ( 2 δ n ) = 1 2 d 2 2 δ n N ( 2 δ + 2 n d 2 ) = 1 2 d 1 2 2 δ d 2 2 n N ( 2 δ + 2 d 1 2 n d 2 2 ) = 1 2 ( d 1 2 2 δ N ( 2 δ + 2 d 1 2 ) ) ( d 2 2 n N ( n d 2 2 ) )
    • If δ is even, then the first sum is

      d 1 2 2 δ N ( 2 δ + 2 d 1 2 ) = λ = 0 δ 2 N ( 2 δ + 2 2 λ ) ( d 1 = 2 λ ) = N ( 4 ) = 2 .

      Thus g ( n ) = d 2 n N ( n d 2 ) , and similarly g ( n 1 ) = d 1 2 n 1 N ( n 1 d 1 2 ) . Therefore

      g ( n 1 ) g ( n 2 ) = d 1 2 n 1 N ( n 1 d 1 2 ) 1 2 d 2 2 n 2 N ( 4 n 2 d 2 2 ) = 1 2 d 1 2 n 1 d 2 2 n 2 N ( 4 n 1 n 2 ( d 1 d 2 ) 2 ) = 1 2 d 2 n N ( 4 n d 2 ) = d 2 n N ( n d 2 ) = g ( n ) .
    • If δ is odd,

      d 1 2 2 δ N ( 2 δ + 2 d 1 2 ) = λ = 0 δ 2 N ( 2 δ + 2 2 λ ) ( where  δ 2 = ( δ 1 ) 2 ) = N ( 2 3 ) + N ( 2 4 ) + = 0 .

      Thus g ( n ) = 0 , and similarly g ( n 1 ) = 0 , so g ( n ) = g ( n 1 ) g ( n 2 ) .

In all cases,

n 1 n 2 = 1 g ( n 1 n 2 ) = g ( n 1 ) g ( n 2 ) .

Since g is a multiplicative function, for n = 3 α p A n p β ( p ) q B n q γ ( q ) , we obtain

R f ( n ) = 6 g ( n ) = 6 g ( 3 α ) p A n g ( p β ( p ) ) q B n g ( q γ ( q ) ) . (1)

We evaluate the values g ( p k ) for the three types of prime numbers in this formula.

  • If p = 3 , N ( 3 0 ) = N ( 3 1 ) = 1 and N ( 3 k ) = 0 if k 2 , because u 2 3 ( mod 3 k ) implies 3 u , so u = 3 v for some integer v , and v 2 1 ( mod 3 k 1 ) , where k 1 1 , thus v 2 1 ( mod 3 ) . This is impossible, thus N ( 3 k ) = 0 for k 2 . This gives

    g ( 3 α ) = 1 2 d 2 3 α N ( 4 3 α d 2 ) = d 2 3 α N ( 3 α d 2 ) ( since  4 ( 3 α d 2 = 1 ) = μ = 0 α 2 N ( 3 α 2 μ ) ( d = 3 μ ) = { N ( 3 ) if  α  is odd, N ( 1 ) if  α  is even

    In both cases,

    g ( 3 α ) = 1 .

  • If p 1 ( mod 3 ) , then ( 3 p ) = ( p 3 ) = 1 , so the congruence x 2 3 ( mod p ) has two solutions, thus N ( p ) = 2 . By Hensel’s Lemma, N ( p β ) = 2 for β 1 (and N ( p 0 ) = 1 ).

    Here p is an odd prime, so

    g ( p β ) = 1 2 d 2 p α N ( 4 p β d 2 ) = d 2 p β N ( p β d 2 ) = ν = 0 β 2 N ( p β 2 ν ) ( d = p ν ) = { N ( 1 ) + N ( p 2 ) + + N ( p β ) if  β  is even , N ( p ) + N ( p 3 ) + + N ( p β ) if  β  is odd.

    Since N ( p β ) = 2 ( β > 1 ) and N ( 1 ) = 1 , we obtain

    g ( p β ) = 1 + 2 β 2 = β + 1  if  β  is even , g ( p β ) = 2 ( β + 1 2 = β + 1  if  β  is odd .

    In both cases,

    g ( p β ) = β + 1 , ( p 1 ( mod 3 ) ) .

  • If q 2 ( mod 3 ) , then ( 3 q ) = ( q 3 ) = 1 , thus so the congruence x 2 3 ( mod q ) has no solution, a fortiori x 2 3 ( mod q ) γ ( γ 1 ) has no solution. Therefore N ( q ) = 0 , and N ( q γ ) = 0 if γ 1 . Then

    • If q 2 ,

      g ( q γ ) = 1 2 d 2 q γ N ( 4 q γ d 2 ) = d 2 q γ N ( q γ d 2 ) = ν = 0 γ 2 N ( q γ 2 ν ) ( d = q ν ) = { N ( 1 ) + N ( q 2 ) + + N ( q γ ) = 1 if  γ  is even , N ( q ) + N ( q 3 ) + + N ( q γ ) = 0 if  γ  is odd.

      By hypothesis, γ ( n ) is even, thus

      g ( q γ ( q ) ) = 1 ( q 2 ) .

    • If q = 2 , we have already proven that N ( 2 k ) = 0 if k 3 , and N ( 1 ) = N ( 2 ) = 1 , N ( 2 2 ) = 2 . Then

      g ( 2 γ ) = 1 2 d 2 2 γ N ( 4 2 γ d 2 ) = 1 2 d 2 2 γ N ( 2 γ + 2 d 2 ) = 1 2 ν = 0 γ 2 N ( 2 γ + 2 2 ν ) = { 1 2 ( N ( 2 2 ) + + N ( 2 γ ) + N ( 2 γ + 2 ) ) = 1 if  γ  is even , 1 2 ( N ( 2 3 ) + + N ( 2 γ ) + N ( 2 γ + 2 ) ) = 0 if  γ  is odd.

      Since γ ( q ) is even by hypothesis, we obtain the same results than in the case q odd: for all q B n , including q = 2 ,

      g ( q γ ( q ) ) = 1 .

With these results, equation (1) gives for n = 3 α p A n p β ( p ) q B n q γ ( q ) ,

R f ( n ) = p A n ( β ( p ) + 1 ) .

Phew! □

Note: I mimicked the proofs of N.Z.M. given in the case of sum of two squares. Using the decomposition of n in prime factors in the Principal Ideal Domain [ ω ] ( ω = e 2 3 ), there must be a shorter proof of this last result.

Some code in Sage to check the preceding results on the functions N and g :

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 g 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’)

User profile picture
2024-12-07 10:43
Comments