Homepage Solution manuals Ivan Niven An Introduction to the Theory of Numbers Exercise 1.3.40* (Which natural numbers are sums of consecutive integers ?)

Exercise 1.3.40* (Which natural numbers are sums of consecutive integers ?)

Say that a positive integer n is a sum of consecutive integers if there exist positive integers m and k such that

n = m + ( m + 1 ) + + ( m + k ) .

Prove that n is so expressible if and only if it is not a power of 2 .

Answers

Proof. If n is a sum of consecutive integers, then

n = i = 0 k ( m + i ) = j = 0 k ( m + k j ) ( where  j = k i ) = i = 0 k ( m + k i ) .

Therefore

2 n = i = 0 k ( m + i ) + i = 0 k ( m + k i ) = i = 0 k ( 2 m + k ) = ( k + 1 ) ( 2 m + k )

(Gauss’ trick). So

n = ( k + 1 ) ( 2 m + k ) 2 ( m > 0 , k > 0 ) .

We prove first that a power of 2 is not so expressible. If 2 u = ( k + 1 ) ( 2 m + k ) 2 , then

2 u + 1 = ( k + 1 ) ( 2 m + k ) .

If k is even, then k + 1 is odd (and k + 1 2 ), and if k is odd, then 2 m + k is odd (and 2 m + k 2 ). In both cases 2 u + 1 has an odd divisor greater that 1 . This is impossible because the only divisors of 2 u + 1 greater than 1 are powers of 2 i , where i 1 , so are all even. □

Take now n > 1 which is not a power of 2 . The decomposition of n in prime factors is

n = 2 r p 2 a 2 p l a l ,

where p 2 a 2 p l a l is odd and greater that 1 (otherwise n is a power of 2 ). Thus

2 n = 2 r ( 2 s + 1 ) , r > 0 , s > 0 .

Consider two cases.

  • If 2 r 1 > s , then define

    k = 2 s > 0 , m = 2 r 1 s > 0 .

    Then

    2 n = ( 2 s + 1 ) 2 r = ( k + 1 ) ( 2 r 2 s + 2 s ) = ( k + 1 ) ( 2 m + k ) ,

    so n = ( k + 1 ) ( 2 m + k ) 2 = i = 0 k ( m + i )  where  k > 0 , m > 0 , is a sum of consecutive integers.

  • If 2 r 1 s , then define

    k = 2 r 1 > 0 , m = s + 1 2 r 1 > 0 .

    Then 2 m + k = 2 s + 2 2 r + 2 r 1 = 2 s + 1 , thus

    2 n = 2 r ( 2 s + 1 ) = ( k + 1 ) ( 2 m + k )

    so n = ( k + 1 ) ( 2 m + k ) 2 ( k > 0 , m > 0 ) is a sum of consecutive integers.

In both cases, n is a sum of consecutive integers.

n is a sum of consecutive integers if and only if n is not a power of 2 .

User profile picture
2024-07-11 09:39
Comments