You are on page 1of 47

# Unit 1

Theory of Numbers
Natural Numbers
The numbers 1, 2, 3, , which are used in counting are called natural numbers or positive integers.

## Basic Properties of Natural Numbers

In the system of natural numbers, we have two operations addition and multiplication with the
following properties.
Let x , y , z denote arbitrary natural numbers, then
1. x + y is a natural number i.e., the sum of two natural number is again a natural number.
2. Commutative law of addition x + y = y + x
3. Associative law of addition x + ( y + z ) = ( x + y ) + z
4. x y is a natural number i.e., product of two natural numbers is a natural number.
5. Commutative law of multiplication x y = y x
6. Associative law of multiplication x ( y z ) = ( x y ) z
7. Existence of multiplicative identity a 1 = a
8. Distributive law x ( y + z ) = xy + xz

Divisibility of Integers
An integer x 0 divides y, if there exists an integer a such that y = ax and thus we write as x | y (x divides y).
If x does not divides y, we write as x \| y (x does not divides y )
[This can also be stated as y is divisible by x or x is a divisor of y or y is a multiple of x].

Properties of Divisibility
1. x | y and y | z x | z
2. x | y and x | z x | (ky lz ) for all k , l z. z = set of all integers.
3. x | y and y | x x = y
4. x | y, where x > 0, y > 0 x y
5. x | y x | yz for any integer z.
6. x | y iff nx | ny, where n 0.
2 Indian National Mathematics Olympiad

Test of Divisibility
Divisibility by certain special numbers can be determined without actually carrying out the process of
division. The following theorem summarizes the result :
A positive integer N is divisible by
2 if and only if the last digit (unit's digit) is even.
4 if and only if the number formed by last two digits is divisible by 4.
8 if and only if the number formed by the last three digits is divisible by 8.
3 if and only if the sum of all the digits is divisible by 3.
9 if and only if the sum of all the digits is divisible by 9.
5 if and only if the last digit is either 0 or 5.
25 if and only if the number formed by the last two digits is divisible by 25.
125 if and only if the number formed by the last three digits is divisible by 125.
11 if and only if the difference between the sum of digits in the odd places (starting from right) and
sum of the digits in the even places (starting from the right) is a multiple of 11.

Division Algorithm
For any two natural numbers a and b, there exists unique numbers q and r called respectively quotient
and remainder, a = bq + r , where 0 r < b.

Common Divisor
If a number c divides any two numbers a and b i.e., if c | a and c | b, then c is known as a common divisor
of a and b.

## Greatest Common Divisor

If a number d divides a and b and is divisible by all the common divisors of a and b, then d is known as
the greatest common divisor (GCD) of a and b or HCF of a and b.
The GCD of numbers a and b is the unique positive integer d with the following two properties.
(i) d | a and d | b
(ii) If c | a and c | b; then c | d
We write it as (a , b ) = d
For example, (12, 15) = 3 ; (7, 8) = 1

## Note 1. (a, b ) = (b, a ) 2. If a|b; then (a, b ) = a

Properties of GCD
1. If ( b , c ) = g and d is a common divisor of b and c, then d is a divisor of g.
2. For any m > 0, (mb , mc ) = m (b , c )
b c 1
3. If d |b and d |c and d > 0, then , = (b , c )
d d d
b c
4. If ( b , c ) = g, then , =1
g g
5. If ( b , c ) = g, then there exists two integers x and y such that g = xb + yc
6. If (a , b ) = 1 and (a , c ) = 1, then ( a , bc ) = 1
7. If a | bc = 1 and (a , b ) = 1, then a | c = 1
Theory of Numbers 3

## For example a = 6, b = 21, c = 10

6 | 21 10 but (6, 21) = 3
and (6, 10) = 2 and 6 divides neither 21 nor 10
LCM of two integers a, b is the smallest positive integer divisible by both a and b and it is denoted by
[a, b].
The Euclidean algorithm can be used to find the GCD of two integers as well as representing GCD as
in 5th property. Consider 2 numbers 18, 28
28 = 1.8 + 10 ; 18 = 110
. + 8
10 = 1 8 + 2 ; 8 = 4 2 + 0
(18, 28) = 2
(18, 28) = 2 = 10 1.8 = 10 (18 110
. )
= 210
. 118
. = 2 (28 118
. ) 118
.
= 228
. 318
. = 228
. + ( 3)18

Note The representation in 5th property is not unique. In fact we can represent (a, b ) as xa + yb in infinite
number of ways where x , y Z
Z = set of all integers.
In above example, 252 is LCM of 18 and 28.
252 = 9.28
252 = 1418
.
(18, 28) = 2 . 28 + ( 3) 18
= 2.28 + 252K + ( 3)18 252K
= ( 2 + 9K )28 + ( 3 14K )18
where K is any integer.

Unit
1 is called unit in the set of positive integers.

Prime
A positive integer P is said to be prime, if
(i) P > 1
(ii) P has no divisors except 1 and P i.e., A number which has exactly two different factors, itself and
one, is called a prime number.
Thus, 2, 3, 5, 7, 11, ... are primes. 2 is the only even number which is prime. All other primes
being odd.
But the converse is not true i.e., every odd number need not be prime.

Composite
Every number (greater than one) which is not prime is called composite number. i.e., a number which has
more than two different factors is called composite. For example 18 is a composite number because 2, 3,
6, 9 are divisors of 18 other than 1 and 18.
We can also define a composite number as : A natural number n is said to be composite, if there exists
integers l and m such that n = lm, where 1 < l < n and l < m < n.
4 Indian National Mathematics Olympiad

Remark
l A prime number P can be written as a product only in one way namely P.1 .
l A composite number n can also be written as n.1. But composite number can be written in one more way
also as mentioned above.
l A composite number has at least three factors.

## Note 1 is neither prime nor composite.

Twin Primes
A pair of numbers is said to be twin primes, if they differ by 2.
e.g., 3, 5 are twin primes.

Perfect Number
A number n is said to be perfect if the sum of all divisors of n (including n) is equal to 2n.
For example 28 is a perfect number because divisors of 28 are 1, 2, 4, 7, 14, 28.
Sum of divisors of n (= 28) = 1 + 2 + 4 + 7 + 14 + 28 = 56 = 2n

Coprime Integers
Two numbers a and b are said to be coprime, if 1 is only common divisors of a and b.
i.e., if GCD of a and b = 1 i.e., if (a , b ) = 1
e.g., (4, 5) = 1, (8, 9) = 1.

Theorem 1 If a = qb + r , then (a , b ) = (b , r ).

## Proof Let (a , b ) = d and (b , r ) = e

Q (a , b ) = d d | a and d | b
d | a and d | qb d | (a qb)
i.e., d |r [Qa qb = r ]
d is common divisor of b and r.
d |e [Qe is the GCD of b and r] (i)
Again Q (b, r) = e
e e
e |b and e |r and
bq r
e|bq + r i.e., e|a [Qa = bq + r ]
e is a common divisor of a and b.
e|d [Qd is the GCD of a and b] (ii)
From Eqs. (i) and (ii), we have d = e
i.e., (a , b ) = (b , r )

Remark
The above result can also be stated as :
GCD of a and b is same as GCD of b and r, where r is remainder obtained on dividing a by b.

Corollary If (a , b ) = 1, then (b , r ) = (a , b ) = 1
i.e., if a is coprime to b, then r is coprime to b. r is remainder obtained on dividing a by b.
Theory of Numbers 5

Theorem 2 If d is the greatest common divisor of a and b, then there exists integers x and y such that
d = xa + yb and d is the least positive value of xa + yb.
Proof
Case I By successive application of division algorithm to numbers a and b.
Let r1 , r2 , K , rn be successive remainders.
Therefore, a = bq1 + r1 , 0 < r1 < b (Dividing a by b)
b = r1q 2 + r2 , 0 < r2 < r1 (Dividing b by remainder r1 )
r1 = r2q3 + r3 , 0 < r3 < r2 (Dividing r1 by remainder r2 )
M
M
M
rn 2 = rn 1qn + rn , 0 < rn < rn 1
rn 1 = rn qn +1 + rn + 1, 0 < rn +1 < rn
Since r1 > r2 > K is a set of decreasing integers, this process must terminate after a finite number of step.
i.e., remainder must be zero after some stage.
So let rn +1 = 0 rn 1 = rn qn +1 + 0 = rn qn +1
rn | rn 1 (rn 1 , rn ) = rn [If a | b, then (a, b ) = a ]
Now, (a, b ) = (b, r1 ) = (r1 , r2 ) = (r2 , r3 ) = K = (rn 1 , rn ) = rn (i)
i.e., GCD of a and b is rn .
From first of above equations r1 = a bq1 = ax 1 + by1, where x 1 = 1, y1 = q ,
Putting the value of r1 = a bq1 in r2 = b r1q 2
r2 = b r1q 2 = b (a bq1 ) q 2 = b aq 2 + bq1q 2
= aq 2 + b (1 + q1q 2 ) = ax 2 + by 2 , where x 2 = q 2
y 2 = 1 + q1q 2
Similarly, r3 = ax 3 + by3 and so on rn = ax n + byn
or rn = ax + by
where x n = x and yn = y
i.e., GCD of a and b = rn can be expressed as (a , b ) = d = ax + by [By Eq. (i)]
Case II (a , b ) = d (Q d | a and d | b)
d | (ax + yb ) for all values of x and y.
an integer k such that xa + yb = kd (ii)
But least value of k is 1.
Putting k = 1 in Eq. (ii), least value of xa + yb is d.

Corollary If a and b are coprime integers i.e., if (a , b ) = 1, then there exists integers x and y such that
ax + by = 1

## Example 1 If (a, b ) = d , then , = 1.

a b
d d

Solution Q (a, b ) = d
d | a and d | b [By definition of GCD].
There exists integers a1and b1 such that a = da1 (i)
b = db1 (ii)
Again Q (a, b ) = d
6 Indian National Mathematics Olympiad

## There exists integers x and y such that

ax + by = d [By Theorem 2]
Putting values of a and b from Eqs. (i) and (ii)
da1x + db1y = d .
or a1x + b1y = 1
(a1, b1) = 1 [By corollary theorem 1]
a b a b
or , =1
QFrom Eq. (i), a1 = , from Eq. (ii), b1 =
d d d d

Remark
(a, b ) = d and a = a1d , b = b1d , then a1 and b1 are coprime i.e., (a1, b1) = 1

## Example 2 If a|bc and (a, b ) = 1, then a|c.

Solution Q a|bc
There exists an integer d such that bc = ad (i)
Q (a, b ) = 1
There exist integers m and n such that am + bn = 1 (ii)
Multiplying both sides of Eq.(ii) by c, acm + bcn = c (iii)
Putting bc = ad from Eq. (i) in Eq. (iii)
acm + adn = c
a(cm + dn ) = c
a|c

Note If a|bc and (a, b ) = 1, then a|c. This result is also known as Gauss Theorem.

## Example 3 Prove that every two consecutive integers are coprime.

Solution Let n and n + 1 be two consecutive integers.
Let (n, n + 1) = d
d |n and d |n + 1
d |(n + 1) n or d |1
d =1
(n, n + 1) = 1
i.e., n and (n + 1) are relatively prime.

## Example 4 Show that GCD of a + b and a b is either 1 or 2, if (a, b ) = 1.

Solution Let (a + b, a b ) = d
d | (a + b ) and d | (a b )
d | (a + b + a b ) and d | (a + b ) (a b )
or d | 2a and d | 2b.
i.e., d is a common divisor of 2a and 2b.
d | ( 2a, 2b ) [By definition of GCD]
Theory of Numbers 7

## i.e., d | 2(a, b ) [Q(ma, mb ) = m (a, b )]

But (a, b ) = 1 d|2
d = 1 or d = 2 .

Example 5 Find GCD of 858 and 325 and express it in the form m 858 + n 325.
Solution 858 = 325.2 + 208 (i)
Dividing 858 by 325
325 = 2081
. + 117 (ii)
Dividing 325 by 208
208 = 1171
. + 91 (iii)
Dividing 208 by 117
117 = 911
. + 26 (iv)
Dividing 117 by 91
91 = 26.3 + 13 (v)
Dividing 91 by 26
26 = 13.2
GCD of 858 and 325 is d = 13
From Eq. (v), d = 13 = 91 26.3
Substituting the value of 26 from Eq. (iv)
91 3(117 911
. ) = 91 3117
. + 3.91 = 4.91 3117
.
Substituting the value of 91 from Eq. (iii)
= 4( 208 117) 3117
. = 4.208 7117
.
Substituting the value of 117 from Eq. (ii)
= 4.208 7( 325 2081) = 4.208 7.325 + 7.208
= 11.208 7.325
= 11( 858 325.2) 7.325 [Putting the value of 208 from Eq. (i)]
= 11.858 22.325 7.325 = 11.858 29.325
= m 858 + n.325 where m = 11, n = 29

Example 6 If a and b are relatively prime, then any common divisor of ac and b is a divisor of c.
Solution a and b are relatively prime
integers x and y such that
ax + by = 1 (i)
Let d be any common divisor of ac and b.
Q d | ac, an integer m such that
ac = dm (ii)
Q d | b, an integer n such that
b = dn (iii)
Multiplying both sides of Eq. (i) by c
acx + bcy = c (iv)
8 Indian National Mathematics Olympiad

Putting the values of ac and b from Eqs. (ii) and (iii) in Eq. (iv).
dmx + dncy = c
or d (mx + ncy ) = c
d|c

Example 7 If a and b are any two odd primes, show that (a 2 b 2 ) is composite.
Solution a 2 b 2 = (a b )(a + b )
Q a.0 and b are odd primes.
So, let a = 2k + 1
b = 2k + 1
a b = 2k + 1 2k 1 = 2k 2k = 2(k k ) is even
a + b = 2k + 1 + 2k + 1 = 2k + 2k + 2 = 2(k + k + 1) is even
Neither (a b ) nor (a + b ) is equal to 1.
Neither of the two divisors (a b ) and (a + b ) of (a 2 b 2 ) is equal to 1.
(a 2 b 2 ) is composite.
[Q Out of the two divisors of a prime number p, one must be equal to 1]

## Example 8 If a |c, b |c and (a, b ) = 1, then ab |c.

Solution Q a |c
There exists an integers d such that
c = ad (i)
Q b|c
There exists an integer e such that
c = be
Q (a, b ) = 1, therefore there exist integers m, n such that
am + bn = 1 (ii)
Multiplying both sides by c
acm + bcn = c (iii)
Putting c = be from Eq. (ii) in acm and c = ad from Eq. (i) in bcn, Eq. (iii) becomes
abem + band = c
ab (em + dn ) = c
ab | c

## Example 9 If a 2 b 2 is a prime number, show that a 2 b 2 = a + b, where a, b are natural numbers.

Solution a 2 b 2 = (a b )(a + b ) (i)
Q (a b ) is a prime number
2 2

## One of the two factors = 1

Q a b =1 [Qa b < a + b ]
Theory of Numbers 9

## Q The only divisor of a prime number are 1 and itself.

Eq. (i) becomes a 2 b 2 = 1 (a + b )
or a 2 b2 = a + b
e.g., 32 22 = 5 (which is prime)
32 22 = 3 + 2, 3, 2 N.

Example 10 Prove that an integer is divisible by 9 if and only if the sum of its digits is divisible by 9.
Solution Let a = an K a 3a 2a1 be an integer
[Note a is not the product of a1, a 2, a 3,, an but a1, a 2, a 3,,an are digits in the value of
a. For example 368 is not the product of 3, 6 and 8 rather 3, 6, 8 are digits in value
of 368
= 8 + 6 10 + 3 (10)2 ]
a = an a 3a 2a1
= a1 + (10)1a 2 + (10)2a 3 + (10)3a 4 + K + (10)n 1an
= a1 + 10a 2 + 100a 3 + 1000a 4 + K
= a1 + (a 2 + 9a 2 ) + (a 3 + 99a 3 ) + (a 4 + 999a 4 ) + ...
= (a1 + a 2 + a 3 + a 4 + K ) + ( 9a 2 + 99a 3 + 999a 4 + K ) (i)
or a = S + 9 (a 2 + 11a 3 + 111a 4 + ... )
where S = a1 + a 2 + a 3 + a 4 + K
is the sum of digits in the value of a
a S = 9 (a 2 + 11a 3 + 111a 4 + ... )
9 | (a S ) (ii)
Case I a is divisible by 9
i.e., 9 |a (iii)
9 | [a (a S )] [From Eqs. (ii) and (iii)]
i.e., 9|S i.e., sum of digits is divisible by 9.
Case II S (sum of digits) is divisible by 9
i.e., 9|S (iv)
From Eqs. (ii) and (iv), 9|[(a S ) + S ]
i.e., 9|a
i.e., the integer a is divisible by 9.

## Theorem 3 Prove that the product of any r consecutive numbers is divisible by r ! .

Proof Let
Pn = n (n + 1)(n + 2) K (n + r 1) (i)
be the product of r consecutives integers beginning with n.
We shall prove the theorem by Induction method.
For r = 1, Pn = n is divisible by 1! for all n.
The theorem is true for r = 1 i.e., the product of 1 (consecutive) integer is divisible by 1!.
Let us assume the theorem to be true for the product of (r 1) consecutive integers.
10 Indian National Mathematics Olympiad

## i.e., every product of (r 1) consecutive integers is divisible by (r 1)! .

Changing n to n + 1 in Eq. (i)
Pn +1 = (n + 1)(n + 2)K (n + r )
Multiplying both sides by n
nPn +1 = n (n + 1)(n + 2) K (n + r )
= n (n + 1)(n + 2) K (n + r 1)(n + r )
nPn +1 = (n + r )Pn
= nPn + rPn
or n (Pn + 1 Pn ) = r Pn
P
or Pn + 1 Pn = r n
n
n (n + 1)(n + 2) K (n + r 1)
=r [Using value of Pn ]
n
or Pn +1 Pn = r (n + 1)(n + 2) K (n + r 1)
or Pn +1 Pn = r
Product of (r 1) consecutive integers.
= rP (i)
Where P denotes the product of (r 1) consecutive integers.
But the product P of (r 1) consecutive integers is divisible by (r 1)! . [By assumption]
P = k (r 1)!
Eq. (i) becomes Pn +1 Pn = rk (r 1)! = kr (r 1) ! = k (r )!
i.e., r ! | (Pn +1 Pn ), n
Put n =1
r !| (P2 P1 )
But P1 = 1 2 3 K r = r ! is divisible by r !
i.e., r1 !| P1
r !| (P2 P1 ) + P1 i.e., r !| P2
Put n = 2,
r !| (P3 P2 )
But r !| P2
r !| (P3 P2 ) + P2
i.e., r !| P3 and so on.
Generalising we can say that r !| Pn for all n.
n
Corollary Cr is an integer
n! n (n 1)(n 2) K (n r + 1)(n r )!
n
Cr = =
r !(n r )! r! (n r )!
n (n 1)(n 2) K (n r + 1)
=
r!
the product of r consecutive integers
= = An integer
r!
(QThe product of r consecutive integer is divisible by r !) .

Note Therefore the product of two consecutive integers is divisible by 2! = 2 ; the product of any three
consecutive integers is divisible by 3 = 6! and so on.
Theory of Numbers 11

Example 1 Prove that product of two odd numbers of the form 4n + 1 is of the form ( 4n + 1) .

Solution Let a = 4k + 1, b = 4k + 1
be two numbers of the form ( 4n + 1)
ab = ( 4k + 1)( 4k + 1)
= 16kk + 4k + 4k + 1
= 4( 4kk + k + k ) + 1 = 4l + 1
(where l = 4kk + k + k )
Which is in form ( 4n + 1) .

## Solution Let n = 2m + 1 be an odd number .

n 2 = ( 2m + 1)2 = 4m 2 + 4m + 1
= 4m(m + 1) + 1
Now, m(m + 1) being product of two consecutive integers, is divisible by 2! = 2
m(m + 1) = 2j
n 2 = 4( 2j ) + 1 = 8j + 1

Example 3(a) Show that sum of an integer and its square is even.
Solution Let n be any integer.
So, we have to prove that n 2 + n is even.
n 2 + n = n(n + 1) which is product of two consecutive numbers n and n + 1 and
hence divisible by 2! = 2
Hence, n 2 + n is an even number.

## Example 3(b) If n is an integer. Prove that product n(n 2 1) is multiple of 6.

Solution n(n 2 1) = n(n 1)(n + 1) = (n 1)n(n + 1)
Which being the product of three consecutive integers is divisible by 3! = 6
n(n 2 1) is divisible by 6.
i . e., n(n 2 1) is a multiple of 6.
Note If n is a multiple of p, we shall write
n = M ( p) .

## Example 4 If r is an integer, show that r (r 2 1)( 3r + 2) is divisible by 24.

Solution r (r 2 1)( 3r + 2) = r (r 1)(r + 1)( 3r + 2)
= (r 1)r (r + 1){3(r + 2) 4}
= 3(r 1)r (r + 1)(r + 2) 4(r 1)r (r + 1)
(r 1)r (r + 1)(r + 2) being the product of four consecutive integers is divisible by
4! = 24
3(r 1)r (r + 1)(r + 2) is also divisible by 24.
12 Indian National Mathematics Olympiad

## Again (r 1)r (r + 1) is divisible by 3! = 6

4(r 1)r (r + 1) is also divisible by 4 6 = 24
r (r 2 1)( 3r + 2) = 3(r 1)r (r + 1)(r + 2) 4(r 1) r (r + 1)
is also divisible by 24.

## Example 5 If m, n are positive integers, show that (m + n )! is divisible by m ! n ! .

(m + n )! 1 2 3 K m(m + 1)(m + 2) K (m + n )
Solution =
m!n ! m!n !
m !(m + 1)(m + 2) K (m + n )
=
m!n !
(m + 1)(m + 2) K (m + n )
=
n!
The product of n consecutive integers
=
n!
= An integer
(m + n )! is divisible by m ! n !.

## Example 6 If ( 4x y ) is a multiple of 3, show that 4x 2 + 7xy 2y 2 is divisible by 9.

Solution Q 4x y is a multiple of 3.
4x y = 3m
y = 4x 3m
On putting value of y in 4x 2 + 7xy 2y 2
= 4x 2 + 7x ( 4x 3m ) 2 ( 4x 3m )2
= 4x 2 + 28x 2 21xm 2 (16x 2 + 9m 2 24xm )
= 4x 2 + 28x 2 21xm 32x 2 18m 2 + 48xm
= 27mx 18m 2 = 9m ( 3x 2m )
4x 7x 2y 2 is divisible by 9.
2

## Example 7 If n is an integer, prove that n (n + 1) ( 2n + 1) is divisible by 6.

Solution n (n + 1) ( 2n + 1) = n (n + 1) [(n + 2) + (n 1)]
= n (n + 1) (n + 2) + n (n + 1) (n 1)
= n (n + 1) (n + 2) + (n 1) n (n + 1)
Each of the two (n 1) n (n + 1) and (n + 2) (n + 1) n being the product of three
consecutive integers is divisible by 3! = 6
n (n + 1) ( 2n + 1) is also divisible by 6.

## Example 8 Prove that 4 does not divide (m 2 + 2) for any integer m.

Solution Q m is an integer.
Either m is even or m is odd.
Case I m is even
So let m = 2k
Theory of Numbers 13

m 2 + 2 = ( 2k )2 + 2 = 4k 2 + 2 = 2 ( 2k 2 + 1)
= (2 an odd integer)
Which is not divisible by 4.
Case II m is odd
Let m = 2k + 1
m 2 + 2 = ( 2k + 1)2 + 2 = 4k 2 + 1 + 4k + 2
= ( 2 + 4k + 4k 2 ) + 1.
Which being an odd integer is not divisible by 4.

## Note Two important formulae.

1. If n is either even or odd,
x n y n = ( x y )( x n 1 + x n 2y + x n 3y 2 + K + y n 1)
2. If n is odd,
x n + y n = ( x + y )( x n 1 x n 2y + x n 3y 2 K + y n 1)

## Example 9 Prove that 8n 3n is divisible by 5.

Solution 8n 3n = ( 8 3)( 8n 1 + 8n 2 . 3 + K + 3n 1)
or 8n 3n = 5 ( 8n 1 + 8n 2.3 K + 3n 1)
8n 3n is divisible by 5.

## Example 10 If p > 1 and 2p 1 is prime, then prove that p is prime.

Solution If possible, let p be not prime
p is composite. (Q p > 1)
p = mn, where m > 1 and n > 1
2p 1 = 2mn 1 = ( 2m )n 1n
Putting 2m = a = an 1n , where a = 2m > 2
= (a 1)(an 1 + an 2 + K + 1n 1)
Now, each of the two factors on RHS is greater than 1.
2p 1 is composite.
But it is contrary to given
p must be prime.

Remark
l
But converse is not true i.e., when p is prime, 2p 1 need not be prime.
l
For example, p = 11 is prime but 211 1 is divisible by 23 and hence is not prime.

## Theorem 4 The number of primes is infinite.

Proof If possible suppose that the numbers of prime is finite.
the greatest prime say q.
Let b denote the product of these primes 2, 3, 5, , q.
i.e., let b = 2 35Kq (i)
let a =b + 1 (ii)
Surely, a 1 (Qa = b + 1 > 1)
14 Indian National Mathematics Olympiad

## The number a must have a prime say factor p i.e., p | a.

Now, p is one of the primes 2, 3, 5, 7 q (Because according to our assumption 2, 3, 5, 7, q are the only
primes).
p |b (Qb = 235
. . K q)
Now p | a and p | b
p |a b or p |1 [Qfrom Eq. (ii), a b = 1]
p =1 (which is impossible) (Q1 is not prime)
So our supposition is false.
The number of primes is infinite.

Theorem 5 Fundamental Theorem of Arithmetic each natural number greater than 1 can be
expressed as a product of primes in one and only one way (except for the order of the factors).

## Example 1 Every natural number other than 1 admits of a prime factor.

Solution Suppose that n 1 is a natural number.
If n itself is a prime number, the example is proved in as much as the prime number
n is a factor of itself.
If n is composite, then n must have factors other than 1 and n.
Let l be the least of these factors of n other than 1 and n.
i.e., 1 < l < n and l | n
Now, we have to prove, l is prime.
If possible let l be not prime.
But l >1
l is composite
integers l1 and l2 such that
l = l1l2 where 1 < l1 < l and 1 < l2 < l
l1| l but l | n
l1| n where 1 < l1 < l < n
i.e., l1( < l ) is a divisor of n other than 1 and n.
But this is a contradiction because l1 < l and l is the least divisor of n other than 1
and n.
Our supposition is wrong.
l is a prime factor of n.

Example 2 Show that every odd prime can be put either in the form 4k + 1 or 4k + 3 (i.e., 4k 1),
where k is a positive integer.
Solution Let n be any odd prime. If we divide any n by 4, we get
n = 4k + r
where 0 r < 4 i.e., r = 0, 1, 2, 3
Either n = 4k or n = 4k + 1
or n = 4k + 2 or n = 4k + 3
Clearly, 4n is never prime and 4n + 2 = 2( 2n + 1)
cannot be prime unless n = 0 (Q 4 and 2 can not be factors of an odd prime)
Theory of Numbers 15

## An odd prime n is either of the form

4k + 1 or 4k + 3.
But 4k + 3 = 4(k + 1) 4 + 3 = 4k 1 (where k = k + 1)
An odd prime n is either of the form 4k + 1 or ( 4k + 3) i.e., 4k 1.
Note 1. Every number of the form 4k + 3 is of the form 4k 1 and conversely.
2. Every number of the form 4k + 1 or 4k 1 is not necessarily prime.
3. The above result should be committed to memory.

Example 3 Show that there are infinitely many primes of the form 4n + 3.
Solution If possible, let number of primes of form ( 4n + 3) be finite.
These primes are 3, 7, 11,, q (put n = 0, 1, 2, )
Let q be the greatest of these primes of the form ( 4n + 3) .
Let a = 3, 7,11, K , q be the product of all primes of the form ( 4n + 3) .
Let b = 4a 1 (i)
b >1 [Qa 3, b = 4a 1, b 11]
By fundamental theorem b can be expressed as a product of primes say
p1. p2. p3 K pr .
i.e., b = p1. p2 K pr (ii)
Now, b = 4a 1 is odd and hence 2 can't be a factor of b.
None of the prime factors in RHS of Eq. (ii) is 2.
i.e., Every prime factor in RHS of Eq. (ii) is odd.
Each of p1, p2, K , pr is of the form ( 4n + 1) or ( 4n + 3) .
Again, all p1, p2, K , pr can't be of the form ( 4n + 1).
[Q If it were so, then b (their product) will also be of the form ( 4n + 1)] .
But this is contrary to Eq. (i) as b = 4a 1 is of the form ( 4n + 3) .
At least one of p1, p2 K pr (say p) is (a prime factor of b) of the form ( 4n + 3) i.e.,
p|b.
Also p|a [Q p is one prime of the form ( 4n + 3) and a is product of all such primes] .
p|4a
p | ( 4a b )
p |1 [Q from Eq. (i), 4a b = 1]
Which is impossible [Q p being prime > 1 ]
Our supposition is wrong.
Number of primes of the form ( 4n + 3) is infinite.

## Theorem 6 The number of divisors of a composite number n : If n is a composite number of the

order n = p1 1 . p 2 2 p k k , then the number of divisors denoted by d (n ) is
(1 + 1)( 2 + 1) K ( k + 1)
Proof Let n be any composite number, let d (n ) denote the number of divisors of composite number n
by Fundamental Theorem of Arithmetic. n can be expressed as the product of the powers of primes.

n = p1 1 . p 2 2 Kp k k , where p1 , p 2 , K , p k are distinct primes and 1 , 2, k are non negative integers.
16 Indian National Mathematics Olympiad

Qp1 is a prime number, therefore, the only divisors of p1 1 are 1, p1, p12 , p13 , K , p1 1

The number of these divisors of p1 1 = 1 + 1

Similarly, the number of divisors of p 2 2 = 2 + 1

The number of divisors of p k k = k + 1

Therefore, the total number of divisors of n = p1 1 p 2 2 K p k k = (1 + 1) ( 2 + 1) K ( k + 1)
i
[Q Every divisor of pi (1 i k ) is a divisor of n]
i.e., d (n ) = (1 + 1)( 2 + 1)( k + 1).
Note Let n = p11 p2 2 p3 3 [ p1, p2, p3 are distinct prime numbers]
Let d (n ) denotes number of divisor .
1. If n is a perfect square then d (n ) is odd
(Q all the di are even)
2. If n is not a perfect square then, d (n ) is even.
[The number of ways of writing n are the product of two factors.]
d (n ) + 1
If n is a perfect square, then number of ways are equal to .
2
d (n )
If n is not a perfect square, then number of ways are equal to .
2

Theorem 7 The sum of the divisors of any composite number n is denoted by (n ) which is equal to
p 1 + 1 1 p2 + 1 1 k + 1 1
1 2 K pk .
p1 1 p2 1 pk 1

Proof Let n be any composite number and let (n ) is sum of positive divisors of n. By Fundamental
Theorem of Arithmetic n can be expressed as the product of the powers of primes.

n = p1 1 . p 2 2 K p k k
[where p1 , p 2 , K , p k are distinct primes and 1 , 2 , K , k are non-negative integers]
Q p1 is prime number

divisors of p1 1 are only 1, p1 , p12 , K , p1 1

1 [ p1 + 1 1]
Sum of these divisors of p1 1 = 1 + p1 + p12 + K + p1 1 =
p 1
a (r n 1)
Q RHS is a Geometric Progression with a = 1, r = p1 , n = 1 + 1 and Sn = r 1

+1
(p2 2 1)
Similarly sum of divisors of p 2 2 =
p2 1
+1
(pk k 1)
Sum of divisors of p k k =
pk 1

(n ) = Sum of divisors of n = p1 1 p 2 2 ... p k k
+1 +1 +1
( p1 1 1) ( p 2 2 1) (p k 1)
= . K k .
( p1 1) ( p 2 1) ( p k 1)
i
[QEvery divisor of pi (1 i k ) is divisor of n]
Theory of Numbers 17

## Note If dk (n ) denotes the sum of k th power of divisor of n, then

( p1k (1 + 1) 1) ( pk2 ( 2 + 1) 1) ( pm
k ( m + 1)
1)
dk (n ) = K
( p1 1)
k
( p2 1)
k
( pm 1)
k

## Example 1 Find the sum of the cubes of divisor of 12.

Solution 12 = 22 3
23(2 + 1) 1 33(1 + 1) 1
dk (12) = = 2044
23 1 33 1

## Example 2 Find the number of divisor of 600.

Solution 600 = 23 31 52
1 = 3, 2 = 1, 3 = 2
Number of divisors = ( 1 + 1)( 2 + 1)( 3 + 1)
= ( 3 + 1)(1 + 1)( 2 + 1) = 4 2 3 = 24

## Greatest Integer Function

Greatest integer function is also known as Bracket Function.
If x is any real number, then the largest integer which does not exceed x is called the integral part of x
and will be denoted by [x ] .
The function which associates with each real number x, the integer [x ] is often called the bracket
function.
For example,  = 3,  = 4, [37
. ]=3

. ] = 5, = 1, [ ] = 4
5
[42
3

## Note 1. [ x ] is the largest integer x.

2. If a and b are positive integer, such that
a = qb + r , 0 r < b
a r r
Then, = q + , where 0 < < 1
b b b
a
=q
b
a
i.e., is the quotient in the division of a by b.
b

## Properties of Greatest Integer Function

(1) [x ] x < [x ] + 1 and x 1 < [x ] x , 0 x , 0 x [x ] < 1

(2) If x 0, [x ] = 1
1 i x

(3) [x + m ] = [x ] + m , If m is an integer.
(4) [x ] + [y ] [x + y ] [x ] + [y ] + 1
(5) [x ] + [x ] = 0, If x is an integer = 1 otherwise.
18 Indian National Mathematics Olympiad

[x ]
(6) = , if m is a positive integer.
x
m m
(7) [x ] is the least integer greater than or equal to x.
This is denoted as (x ) (read as ceiling x)
. ) = 3, (25
For example, ( 25 . )= 2
(8) [x + 05
. ] is the nearest integer to x.
If x is midway between two integers, [x + 05
. ] represents the larger of the two integers.

(9) The number of positive integers less than or equal to n and divisible by m is given by
n
.
m

## (10) If p is a prime number and e is the largest exponent of p such that

n
pe | n ! , then e =
i =1 p
i

[a ] a
Theorem 1 If a is real number, c is natural number, then
c = c

Proof Let [a ] = n i.e., n is largest integer a
a = n + r, 0 r < 1 (i)
[a ] n
c = c = m
Let

n
= m + s, where 0 s < 1
c
n = mc + cs, where 0 cs < c (ii)
[a ]
LHS = = = m
n
Now,
c c
n + r
RHS = =
a
[Putting value of a from Eq. (i)]
c c

## Putting the value of n from Eq. (ii).

mc + cs + r
=
c

cs + r
= m +
c
From Eq. (ii), cs (c 1) and r < 1
Adding cs + r < c 1 + 1
cs + r < c
cs + r
<1
c
cs + r
RHS = m + =m
c
LHS = RHS.
Theory of Numbers 19

x + x + 1 = [x ]
2 2

## Proof First suppose that x = 2m + y , where m is an integer and 0 y < 1.

[x ] = 2m , = m
x
2

x + 1 = 2m + 1 + y = m
2 2
1 1+y
Since <1
2 2

x + x + 1 = [x ]
2 2

## Next, let x = (2m + 1) + y , where m is an integer and 0 y < 1.

Then, x = m , x + 1 = (2m + 2) + y = m + 1
2 2 2

[x ] = 2m + 1

x + x + 1 = [x ]
2 2

## Example 1 Find the highest power of 3 contained in 1000!.

Solution p = 3, n = 1000
n 1000 1
p = 3 = 333 3 = 333

n 333
p 2 = 3 =  = 111

n 111
p 3 = 3 = [ 37] = 37

n 37 1
p 4 = 3 = 12 3 = 12

n 12
p 5 = 3 = [ 4] = 4

n 4 1
p 6 = 3 = 1 3 = 1

n 1
p 7 = 3 = 0

Highest power of 3 contained in 1000!
n n n n n n n
= + 2 + p3 + p4 + p5 + p6 + p7
p p
= 333 + 111 + 37 + 12 + 4 + 1 + 0 = 498
20 Indian National Mathematics Olympiad

n + 1 2n
If n and k are positive integers and k is greater than 1, then +
n
Theorem 3
k k k
Proof Let n = qk + r , q and r are integers and
0 r k 1
n r n+1 r +1
Then, =q + , =q + ,
k k k k
2n 2r
= 2q +
k k
n + 1
(i) r < k 1, then = q , = q , 2q
n 2n
k k k
The desired result is immediate.
(ii) r = k 1, then
n = q , n + 1 = q + 1,
k k

2n = 2q + 2(k 1) = 2q + 1
k k

n + n + 1 = 2n
k k k

## Theorem 4 If n be any positive integer, then show that

n + 1 + n + 2 + n + 4 + n + 8 + K = n
2 4 8 16

## Proof We know that,

x + 1
[x ] = +
x
2 2

n n n n
Applying above formula to n , , , , ,K
2 4 8 16
n + 1
[n ] = +
n
2 2

n = n + (n / 2) + 1
2 4 2

n = n + (n / 4) + 1
4 8 2

n = n + (n / 8) + 1
8 16 2

Adding corresponding sides and cancelling out the terms , , , from both sides, we have
n n n
2 4 8
n + 1 n + 2 n + 4
n= + + +K
2 4 8

[n ] = n
Theory of Numbers 21

## Theorem 5 For every real number x

[x ] + x + + x + + K +
1 2 x + n 1 = [nx ]
n n n
Proof Let x = [x ] + y , where 0 y < 1
Let p be an integer such that
p 1 ny < p
(This is always possible because given a real number, we can always find two consecutive integers
between which the number lies).
k k
Now, x + = [x ] + y +
n n
k p 1+ k p+k
Also, y + lies between and
n n n
p 1+ k
So long as < 1,
n
i.e., k < n (p 1)
k
y + is less than 1 and consequently
n
k
x + n = [x ]

k
x + n = [x ]
i.e., for k = 0, 1, , n p

k
But x + = [x ] + 1, for k = n p + 1,, n 1
n
n 1
[x ] + x + + K + x +
1

n n
= [x ] + K + [x ](n p + 1 times) + ([x ] + 1) + ([x ] + 1) + K ( p 1) times
= n[x ] + ( p 1) (i)
Also, [nx ] = [n[x ] + ny ] = n[x ] + ( p 1)
Since p 1 ny < p (ii)
From Eqs. (i) and (ii)
n 1
[x ] + x + + x + + K + x +
1 2
= [nx ]
n n n

## Theorem 6 The highest power of a prime number p contained in n ! is given by

n n n
k (n !) = + 2 + 3 + K
p p p

Proof Let k (n !)denote the highest power of p contained in n !n ! is the product of the factors 1, 2, 3, , n.
The factors in n ! which will be divisible by p are
n
p , 2p , 3p , K p
p
n n
k (n !) = + k ! (i)
p p
22 Indian National Mathematics Olympiad

n
Changing n to in Eq. (i)
p
n n n
k ! = 2 + k 2 ! (ii)
p p p
Putting the value from Eq. (ii) in Eq. (i)
n n n
k (n !) = + 2 + k 2 !
p p p
n n n
Continuing this process, we get k (n !) = + 2 + 3 + K
p p p
This process must end after a finite number of steps.

Congruences
If a and b are two integers and m is a positive integer, then a is said to be congruent to b modulo m, if m
divides a b denoted by m | (a b ).
In notation form we express it as a b mod m or a b 0 mod m.

## Note 1. a b mod m, then m | (a b ) or (a b ) is a multiple of m.

2. If m | (a b ) [m does not divides (a b )], then a is said to be incongruent to b mod m and this
fact is expressed as a is not congruent to b mod m.
3. If m | a, then a 0 mod m
For example :
(i) 13 1 mod 4 (Q 4 | (13 1) = 12)
(ii) 4 1 mod 5 (Q 5 | ( 4 ( 1)) = 5)
(iii) 12 0 mod 4 (Q 4|12)
(iv) 17 is not congruent to 3 mod 5 (Q 5 | (17 3))

## Theorem 7 If a b mod m, then

(i) a + c = b + c mod m
(ii) ac bc mod m, where c is any integer.
Proof (i) Qa b mod m
m | (a b)
m | {(a + c ) (b + c )} [Qa + c ( b + c ) = a b ]
a + c b + c mod m
(ii)Qa b mod m
m | (a b )
m | c (a b )
m | (ac bc )
ac bc mod m

## Note The converse of theorem 15 (ii) is not true.

Theorem states that if a b mod m, then ac bc mod m.
i.e., a congruence can always be multiplied by an integer
But the converse is not true i.e.,. It is not always possible to cancel a common factor from a
congruence.
For example : 16 8 mod 4 [Q 4|16 8]
But if we cancel the common factor 8 from numbers 16 and 8, we get 2 1 mod 4 which is a false
result because 4 | ( 2 1)
Theory of Numbers 23

## Theorem 8 If a b mod m and c d mod m, then

(i) a + c b + d mod m (ii) a c b d mod m (iii) ac bd mod m
Proof (i) Qa b mod m and c d mod m
m | (a b ) and m| (c d )
m | ((a b ) + (c d ))
or m | ((a + c ) (b + d ))
a + c b + d mod m
(ii) a b mod m and c d mod m
m | (a b ) and m | (c d )
m | (a b ) (c d ) or m | (a c ) (b d )
a c b d mod m
(iii)Qa b mod m and c d mod m
m | (a b ) and m | (c d )
There exists integer h and k such that
a b = mh and c d = mk
a = b + mh and c = d + mk
Multiplying the two equations, we get
ac = (b + mh )(d + mk ) = bd + mbk + mhd + m 2hk
ac bd = m (bk + hd + mhk )
By definition of divisibility m | (ac bd )
or ac bd mod m

## Corollary If a b mod m, then a 2 b 2 mod m

Q a b mod m and again
a b mod m
Multiplying the two congruence a 2 b 2 mod m

Theorem 9 (i) Prove that a a mod m i.e., every integer is congruent to itself.
(ii) If a b mod m, then prove that b a mod m
(iii) If a b mod m, b c mod m prove that a c mod m
Proof (i) We know that m|0 (m 0)
m | (a a )
a a mod m [by definition of congruence]
(ii) Let a b mod m
m | (a b )
m | (a b ) or m | (b a )
b a mod m
(iii) Let a b mod m and b c mod m
m | ( a b ) and m | (b c )
m | ( a b ) + (b c ) or m | ( a c )
a c mod m
24 Indian National Mathematics Olympiad

## Proof We know that,

a k b k = (a b )(a k 1 + a k 2b + a k 3b 2 + K + b k 1 ) (i)
But a b mod m m | (a b )
There exists an integer t such that
a b = mt (ii)
Putting this value of (a b ) from Eq. (ii) in Eq. (i)
a k b k = mt (a k 1 + a k 2b + K b k 1 )
m| (a k b k )
a k b k mod m

1 2
Theorem 11 If a b mod m and f (x ) = p 0x n + p1x n + p 2x n + K +pn 1x + pn is an integral
rational function of an indeterminate x with integral coefficients, then f ( a ) f ( b ) mod m
1 2
Proof Q f ( x ) = p 0x n + p1x n + p 2x n + K + pn 1 x + pn
Putting x = a
1 2
f ( a ) = p 0an + p1an + p 2an + K + pn 1 a + pn (i)
Putting x = b
1 2
f (b ) = p 0bn + p1bn + p 2bn + K + pn 1b + pn (ii)

## Subtract Eq. (i) from Eq. (ii), we get

1 1
f (a ) f (b ) = p 0 (an bn ) + p1 (an bn ) + K + pn 1 (a b)
n 1 n 2 n 1
= p 0 (a b )(a +a b + K+ b )+
n 2 n 3 n 2
p1 (a b )(a +a b + K+ b ) + K + pn 1 (a b)
1 2 2 2 3 2
or f (a ) f (b ) = (a b )[p 0 (an + an b + K + bn ) + p1 (an + an b + K + bn )
+ K + pn 1] (iii)
= (a b ) t (say)
But a b mod m (given)
m| (a b )
an integer k such that a b = mk
Putting this value of a b = mk in Eq. (iii)
f (a ) f (b ) = mkt
m |f (a ) f (b )
f (a ) f (b ) mod m

## Theorem 12 Fermat Theorem

If p is prime, then
(a + b ) p = (a p + b p ) mod p.

## Proof Expanding by binomial theorem

(a + b ) p = a p + pC1a p 1b + pC2ap 2b 2 + K + pCp 1abp 1 + bp
p 1
or (a + b ) p = (ap + bp ) + p
Cr ap r br (i)
r =1
Theory of Numbers 25

p!
Now, p
Cr = ; 1 r (p 1)
r !(p r )!
But p ! = 123
. . p is divisible by p
p is coprime to r !
Q p is coprime to 1, 2, 3, r (Qr < p , p is prime)
p is co prime to their product = r !
Also for the same reason p is coprime to (p r )!
p!
p
Cr = is divisible by p.
r !(p r )!
an integer k r such that
p
Cr = pk r
p
Putting this value of Cr in Eq. (i)
p 1
(a + b )p (ap + bp ) = p kr ap r br
r =1

which is divisible by p.
(a + b )p (ap + bp ) mod p

Generalization
If p is a prime number, prove that
(a1 + a 2 + a3 + K + an ) p
(a1p + ap2 + a3p + K + anp ) mod p
(a1 + a 2 + a3 + K + an ) p = (a1 + b1 ) p
where b1 = a 2 + a3 + K + an
(a1p + b1p ) mod p.
[a1p + (a 2 + a3 + K + an ) p ] mod p
[a1p + (a 2 + c 2 ) p ] mod p
where c 2 = a3 + a 4 + K + an (a1p + ap2 + c p2 ) mod p
continuing like this, we get
(a1 + a 2 + a3 + K + an ) p (a1p + ap2 + K + anp ) mod p

ap = a mod p

## Proof We know that,

(a1 + a 2 + a3 + K + an ) p (a1p + ap2 + a3p K + anp ) mod p (i)
Putting a1 = a 2 = a3 = K = an = 1 in Eq. (i)
(1 + 1 + 1 + K + 1) p
(1p + 1p + 1p + K + 1p ) mod p
or n (1 + 1 + 1 + K + 1) mod p
p

## or n n mod p for every natural number n.

p

Replacing n by a.
ap = a mod p
26 Indian National Mathematics Olympiad

## Theorem 14 Fermat Little Theorem

If p is a prime number and (a , p ) 1, prove that ap 1 = 1 mod p.

Proof As p is prime.
ap = a mod p
Cancelling a from both sides. [a is coprime to p]
p 1
We have a 1 mod p.

2 n 1 n
Theorem 15 n ! = nn n C1 (n 1)n + n C2 (n 2)n ... + (1)n Cn 22
n
+ (1)n Cn 1

## Proof Expanding by binomial theorem

1) x 2) x n 2 2x n 1 x
(e x 1)n = enx n C1e (n + n C2e (n K + n Cn 2 (1) e + n Cn 1 (1) e + (1)n (i)

2 3
We know that e = 1 + + + +K
1! 2! 3!
Using this expansion of e , Eq. (i) becomes
n
x x 2 x3 xn
1 + + + + K+ + K 1
1 ! 2 ! 3 ! n !
(nx )2 (nx )n (n 1)x [(n 1)x ]2 [(n 1)x ]n
+ K n C1 1 +
nx
= 1 + + + K+ + + K+ + K
1! 2! n!
1! 2! n!
(n 2) x [(n 2) x ]2 [(n 2) x ]n
+ n C2 1 + + +K + + K
1! 2! n!

n 2 2x (2x )2 (2x )n
+ K + n Cn 2 (1) 1 + + +K+ + K
1! 2! n

1n x x2 xn
+ (1)n Cn 1
1 + + + K+ + K + (1)n
1! 2! n!
n
Comparing coefficient of x on both sides
nn n (n 1)n (n 2)n
1= C1 + n C2 K+
n! n! n!
2n (1)n 1 n Cn 1
(1)n 2 n Cn 2 +
n! n!
Multiplying both sides by n !
2 n 1 n
n ! = nn n C1 (n 1)n + n C2 (n 2)n K + (1)n Cn 22
n
+ (1)n Cn 1

## Theorem 16 Wilson Theorem

If p is prime, then (p 1)! + 1 0 mod p
Proof
Case I when p = 2
(2 1)! + 1 0 mod 2 [Putting p = 2 in (p 1)! + 1 0 mod p ]
1 ! + 1 0 mod 2
2 0 mod 2
which is true
Wilson theorem is true for p = 2 .
Theory of Numbers 27

## Case II If p is an odd prime.

2 n 1 n
n ! = nn n C1 (n 1)n + n C2 (n 2)n ... + (1)n Cn 22
n
+ (1) n Cn 1

## Put n = p 1 on both sides

( p 1)! = ( p 1) p 1 p 1
C1 ( p 2) p 1
p 1
+ C2 ( p 3) p 1 + .. + (1) p 3 p 1
Cp 32p 1 + (1) p 2 p 1
Cp 2 (i)

Q p is prime.
p is coprime to all numbers < p.
i.e., p is coprime to p 1, p 2, p 3, 2, 1.
Putting a = p 1, p 2, p 3, 2 in Fermat Theorem
ap 1 mod p
( p 1) p 1 1 mod p
or ( p 1) p 1 1 = M(p)
( p 1) p 1 = M ( p ) + 1
Similarly, ( p 2) p 1 = M ( p ) + 1
( p 3) p 1 = M ( p ) + 1

2p 1 = M ( p ) + 1
Putting these values of ( p 1) p 1 , ( p 2) p 1, , 2p 1 in Eq. (i).
p 1 p 1
( p 1)! = [M ( p ) + 1] C1[M ( p ) + 1] + C2[M ( p ) + 1] + .. + (1) p 3 p 1Cp 3

[M ( p ) + 1] + (1) p 2 p 1Cp 2
p 1
p 1 p 1
or ( p 1)! = M ( p ) + 1 C1 + C2 K + (1) p 3 Cp 3 + (1) p 2 p 1Cp 2

## Adding and Subtracting (1) p 1 in RHS.

( p 1)! = M (p ) + [(1) p 1 p 1
C1 + p 1
C2 p 1
C3 + K + (1) p 3 p 3Cp 3

## + (1) p 2 p 1Cp 2 + (1) p 1 ] (1) p 1

( p 1)! = M ( p ) + (1 1) p 1 (1) p 1
( p 1)! = M ( p ) + 0 (1) p 1 = M ( p ) 1
Qp is odd. p 1 is even.
(1) p 1 = 1
or ( p 1)! + 1 = M ( p )
( p 1)! + 1 is divisible by p.
( p 1)! + 1 0 mod p.

## Theorem 17 Converse of Wilson Theorem

If p > 1 and ( p 1)! + 1 0 mod p, then p is a prime number.
Proof If possible let p be not prime.
p is composite (Qp > 1).
So let p = p1p 2, where (1 < p1 < p , 1 < p 2 < p ) or 1 < p1 p 1, 1 < p 2 p 1
28 Indian National Mathematics Olympiad

Now, 1 < p1 p 1
p1 is one of the factors in the value of ( p 1)! and therefore p1 divides ( p 1)! .
Also p = p1p 2 (i)
p1 | p (ii)
But ( p 1)! + 1 0 mod p
p | ( p 1)! + 1 (iii)
From Eqs. (ii) and (iii)
p1 | ( p 1)! + 1 (iv)
From Eqs. (iv) and (i)
p1 | ( p 1)! + 1 (p 1)!
i.e., p1 | 1
But this is impossible. (Qp1 > 1)
p is a prime number.

Eulers Function
Definition : The number of integers n and coprime to n is called Euler's function for n and is denoted by
(n ).
Examples
(1) = 1
[Q1 is the only integer 1 and coprime to 1].
( 2) = 1
[Q1 is the only integer < 2 and coprime to 2].
(8) = 4
[Q1, 3, 5, 7 are the only four integers < 8 and coprime to 8].

Remark
l
If p is a prime number, then 1, 2, 3, ( p 1) are all less than p and coprime to p and are ( p 1) in total.
( p) = p 1

1 1 1
Theorem 18 Prove that (n ) = n 1 1 K 1 where p1 , p 2 , ... , pr are distinct prime
p1 p2 pr
factors of n.
Proof Q p1 , p 2 , K , pr are distinct prime factors of n.
k k
n = p1 1 . p 2 2 K prkr
k k k k
(n ) = ( p1 1 . p 2 2 ... prkr ) = ( p1 1 ) ( p 2 2 ) K ( prkr )
[Qp1 , p 2 , K , pr are distinct primes and hence are coprime to each other and (ab ) = (a ) (b ), if a and b are
coprime to each other.]
k 1 k 1 1
= p1 1 1 p 2 2 1 K prkr 1
p1 p2 pr
k k 1 1 1
= p1 1 . p 2 2 K prkr 1 1 K 1
p1 p 2 pr

1 1 1 k k
= n 1 1 K 1 [Qn = p1 1 . p 2 2 K prkr ]
p1 p2 pr
Theory of Numbers 29

1
Theorem 19 Prove that ( p k ) = p k 1 , where p is prime.
p

Proof Number of integers from 1 to p k which are not coprime to p k are p.1, p.2, p.3, p. p k 1.
Total number of such integers, which are not coprime to p k = p k 1.
(p k ) = Number of integers coprime to p k and < p k .
= p k p k 1 = p k (1 1 / p )

Remark
If a and b are coprime to each other, then (ab ) = (a ) (b ).

Example 1 Find the number of positive integers 3600 that coprime to 3600.
Solution n = 3600 = 24 32 52
(n ) = ( 3600) = ( 24 32 52 )
1 1 1 1 1 1
= n 1 1 1 = 3600 1 1 1
p1 p2 p3 2 3 5
[Here p1 = 2, p2 = 3, p3 = 5]
1 2 4
= 3600
2 3 5
( 3600) = 960

## Solution If (a, m ) = 1, then (m a, m ) = 1

Integers coprime to m occur in pairs of type a and m a .
(m ) is even.

## Example 3 For what values of m is (m ) odd.

Solution If m > 2, (m ) is even.
(1) = 1
( 2) = 1
Only for m = 1, m = 2
(m ) is odd.
10n 1 10n 1
Concept Let a = =
10 1 9
10n 1
We can express any a of the form in terms of perfect square.
9
10n 1
a= 9a = 10n 1
9
9a + 1 = 10n
Let b = 9a + 1
c = 8a + 1
Now, consider 4ab + c = 4a (9a + 1) + 8a + 1 = 36a 2 + 12a + 1 = (6a + 1)2
30 Indian National Mathematics Olympiad

## Verification (6 1 + 1)2 = 72 = 49 = (6 11 + 1)2 = 672

(6 111 + 1)2 = 6672
Now, consider
(a 1) b + c = (a 1)(9a + 1) + 8a + 1
= 9a 2 + a 9a 1 + 8a + 1 = 9a 2 = (3a )2
Verification a = 1 32
a = 11 (33)2
Now, consider (16ab + c )
16a (9a + 1) + 8a + 1
(12a + 1)2
This is also a perfect square.
Concept Prove that every number of the sequence 49, 4489, 44489, 4448889 is a perfect square.
If there are n fours and (n 1) eight and one 9.
Let us denote 444889 as 43829.
Consider 667 written as 627
We know 444889 = (667)2.
We develop (6nm 17)
2
= 4n 8n 19

## If this is true then

2 2 2
6(10n 1) 6 10n + 3 2 . 10n + 1
(6n 17)
2
= + 1 = =
9 9 9
. 2n
410 . n + 1 40n 140n 1 + 1
+ 410
= = = 4n 8n 19
9 9

Example 1 Let n be the natural number. If 2n + 1 and 3n + 1 are perfect square. Then prove that n
is divided by 40.
Solution 40 = 23 5. It is sufficient to prove that n is divisible by 8 and 5.
Let 2n + 1 = x 2 (i)
and 3n + 1 = y 2 (ii)
x 2 is odd.
x is odd.
Let x = 2a + 1
( 2n + 1) = ( 2a + 1)2
2n + 1 = 4a 2 + 4a + 1
n = 2a 2 + a
n is even.
If n is even 3n + 1 is odd
y 2 is odd y is odd
Let y = 2b + 1
Subtract Eq. (i) from Eq. (ii), we get
n = y2 x2 (iii)
Theory of Numbers 31

n = ( 2b + 1)2 ( 2a + 1)2
We know square difference of odd number is always divisible by 8.
n is divisible by 8. (iv)
If we eliminate n between 1 and 2
3x 2 2y 2 = 1
Since square of odd number ends with 1, 5 or 9
3x 2 ends with 3, 5 or 4, 7
2y 2 ends with 2, 0, 8
x 2 ends with 1 and y 2 ends with 1
n = y2 x2 [from Eq. (iii)]
=0
It is divisible by 5.

Example 2 Prove that there are infinitely many squares in the sequence 1, 3, 6, 10, 15, 21, 28,
Solution Suppose Tn is a square
n(n + 1)
Let Tn of the above sequence be
2
n(n + 1)
Tn =
2
If it is a square then Tn = (m )2
n(n + 1)
= (m )2
2
n(n + 1) = 2(m )2
Also, T4n (n + 1) is also a square.
4n(n + 1)[ 4(n )(n + 1) + 1]
T4n (n + 1) =
2
4( 2m 2 )[ 4n 2 + 4n + 1]
= = 4m 2( 2n + 1)2
2
T4n (n + 1)is also a perfect square.
perfect squares are T1 = 1
T8 = 36 is a perfect square.
T288 is also a perfect square.

## Example 3 If N = 123 34 52, find the total number of even factor of N.

Solution If N = 123 34 52
Then, N = 26 37 52
Total Number of factors are = ( 6 + 1)(7 + 1)( 2 + 1) = 7 8 3 = 168
In above factors, some of these are odd multiple and some are even.
The odd multiples are formed only with combination of 35 and 55.
So total number of odd multiples is
(7 + 1)( 2 + 1) = 24
Even multiples = 168 24 = 144
32 Indian National Mathematics Olympiad

## Example 4 Show that n 2 3n 19 is not a multiple of 289 for any integer n.

Solution Suppose 172 | n 2 3n 19
Since n 2 3n 19 = (n + 7)(n 10) + 51
17| (n + 7)(n 10);
172 | (n + 7)(n 10) (Q n + 7 n 10 (mod 17))
172 | (n 2 3n 19) (n + 7)(n + 10)
i.e., 172 |51 which is a contradiction
Consequently n 2 3n 19 is not a multiple of 289.

## Example 5 Determine all integers n such that n 4 n 2 + 64 is the square of an integer.

Solution Since n 4 n 2 + 64 > n 4 2n 2 + 1 = (n 2 1)2 for some non negative integer k,
(n 4 n 2 + 64) = (n 2 + k )2 = n 4 + 2n 2k + k 2
64 k 2
i.e., n 2 = from which we find that the possible values 64, 1, 0 for n 2 are
2k + 1
obtained when k = 0, 7, 8 respectively.
Hence, n ( 0, 1, 8)

## Example 6 Let a, b, c, d , e be consecutive positive integers such that b + c + d is a perfect square

and a + b + c + d + e is a perfect cube. Find smallest possible value of c.
Solution a, b, c, d, e are consecutive positive integer b + c + d = 3c and a + b + c + d + e = 5c
Now, 3|3c 32 | 3c (Q 3c is a square)
3|c 3|5c 33 |5c (Q 5c is a cube)
Also 5 | 5c 5 |5c 5 | c
3 2

## 3352|c i.e., 675|c

675 being a possible value of c is the smallest of such numbers.

## Example 7 If 11 + 11 11a 2 + 1 is an odd integer where a is a rational number. Prove that a is

perfect square.
Solution Let = 11 + 11 11a 2 + 1
Then, ( 11)2 = 112(11a 2 + 1)
Simplifying, we get ( 22) = 113a 2
r
Putting | a | = , r , s N such that (r , s ) = 1 gives ( 22)s 2 = 113r 2.
s
Since 112| s because otherwise 11 would divide r,11|. Writing 11 = , we get
( 2)s 2 = 11r 2
Since 11| s for otherwise we would have 11|r. It follows that s = 1. Thus we have
( 2) = 11r 2. Since 2 and are consecutive odd integers they are relatively
prime.
If 11| 2, then is a square of form 11n + 2 which is not possible.
11| and hence = 11n 2 for some n N.
Thus, we have = 11 = 112n 2
Theory of Numbers 33

Example 8 Determine all pairs of positive integers (m, n ) for which 2m + 3n is a perfect square.
Solution Let 2m + 3n = k 2
Since ( 1)m 2m k 2 1 (mod 3) (Q 3 | k )
m is even, say 2p.
Now, (k 2p ) (k + 2p ) = 3n
k 2 = 1 and k + 2 = 3n 2p + 1 + 1 = 3n
p p

## Since ( 1)n 3n (mod 4) = 2p + 1 + 1 1, n is even, say 2q.

Now ( 3q 1)( 3q + 1) = 2p + 1 3q 1 = 2
3q = 3 q = 1 and hence p = 2
So, we have only one solution (4, 2).

## Example 9 Determine the set of integers n for which n 2 + 19n + 92 is a square.

Solution Let n 2 + 19n + 92 = m 2, m is a non negative integer. Then, n 2 + 19n + 92 m 2 = 0
1
Solving for n, we get n = ( 19 4m 2 7 )
2
4m 2 7 is a square i.e., 4m 2 7 = p 2
Where p N
( 2m p )( 2m + p ) = 7
2m + p being positive therefore (2m+p) is 7 and 2m p = 1
Hence, 4m = 8 m = 2
Thus, we have n 2 + 19n + 92 = 4
n 2 + 19n + 88 = 0
(n + 8)(n + 11) = 0
n = 8 or 11

## Example 10 Find n, if 2200 2192 31 + 2n is a perfect square.

Solution 2200 2192 31 + 2n = 2192( 28 31) + 2n = 2192( 256 31) + 2n = 2192 225 + 2n
For some m N
2n = m 2 2192 225 = m 2 ( 296 15)2 = (m 296 15)(m + 296 15)
So, m = 296 15 = 2 and m + 296 15 = 2 + for some non negative integers , .
Hence, 297 15 = 2 + 2 = 2 ( 2 1)
2 = 297 and 2 1 = 15.
i.e., = 97 and = 4
n = 2 + = 198

Example 11 Find the number of values of n for which 211 + 28 + 2n is a perfect square.
Solution We can write 211 + 28 + 2n as
28 ( 23 + 1) + 2n
28 9 + 2n
2n ( 28n 9 + 1)
34 Indian National Mathematics Olympiad

Note that for any k < 8, 2k ( 28 k 9 + 1) is not a square, when k is odd, 2k is not a square
and in the other case, the second factor is not a square. Hence n 8. Now write
211 + 28 + 2n as 28( 9 + 2n 8 ). Then the problem is to find the number of non negative
integers k such that 9 + 2k is a square.
9 + 2k = t 2 2k = (t 3)(t + 3)
t 3 = 2p and t + 3 = 2p + q for some non negative integers p and q.
2p ( 2q 1) = 6 implying p = 1 from which it follows that t = 5.
Hence, there is a unique solution.

## Example 12 Find all positive integers n for which n 2 + 96 is a perfect square.

Solution Suppose m is a positive integer, such that n 2 + 96 = m 2
Then, m 2 n 2 = 96 (m n )(m + n ) = 96
since m n < m + n and m n,m + n must be both even [as m + n = (m n ) + 2n.
Therefore m n, m + n must be both odd or both even; also if both of them are odd,
then the product cannot be even.
Only possibilities are
m n = 2, m + n = 48 m = 25, n = 23
m n = 4,m + n = 24 m = 14, n = 10
m n = 6, m + n = 16 m = 11, n = 5
m n = 8,m + n = 12 m = 10, n = 2

Example 13 Give with justification, a natural number n for which 39 + 312 + 315 + 3n is a perfect
cube .
Solution 39 + 312 + 315 + 3n = 39(1 + 34 + 36 + 3n 9 )
= ( 33 )3{1 + 3 32 + 3( 32 )2 + ( 32 )3 + 3n 9 3( 32 )2}
= ( 33 )3(1 + 32 )3 provided 3n 9 35 = 0
= ( 270)3 provided 3n 9 = 35
i.e., provided n = 14
So, given number is a perfect cube when n = 14

## Example 14 Prove that 2p + 3p is not a perfect power if p is a prime number.

Solution If p = 2, 2p + 3p = 22 + 32 = 13 (not a perfect power)
Let now p be a prime > 2..
x + a divides x p + a p , whenever p is odd [factor theorem]
2p + 3p is divisible by 2 + 3 = 5. We shall show that 2p + 3p is not divisible by 52.
x p + 3p = ( x + 3)( x p 1 3x p 2 + 32 x p 3 + K + ( 3)p 1)
When x = 3, then
x p 1 3 x p 2 + K + ( 3 )p 1
= ( 3 )p 1 3 ( 3 )p 2 + K + ( 3 )p 1
= p 3p 1
Theory of Numbers 35

## Showing that x + 3 does not divide

x p 1 3 x p 2 + 3 2 x p 3 + K + ( 3 )p 1
Consequently ( x + 3)2 does not divide x p + 3p. So, ( 2 + 3)2 does not divide
2p + 3p . Since 2p + 3p is a multiple of 5 but is not a multiple of 52.
it cannot be a perfect power.

Example 15 A 4 digit number has the following properties (I) It is a perfect square (II) its first 2 digit
are equal to each other (III) its last two digit are equal to each other.Find all such four
digit number.
Solution We want to find positive integers x and y such that1 x 9,0 y 9 and xxyy is a
perfect square. Since,102 = 100, 1002 = 10000. It follows that xxyy must be the square
of a 2 digit number. Suppose that (ab )2 = xxyy .
The number xxyy is clearly a multiple of 11.
Since, it is a perfect square it must be a multiple of 112 i.e., 121.
It must be of the form
121 1, 121 4, 121 9, 121 16, 121 25,
121 36,121 49,121 64,121 81
Out of these 121 64 i.e., 7744 is of the form xxyy, we conclude that 7744 is the
desired number.

Example 16 Show that for any integer n, the number n 4 20n 2 + 4 is not a prime number.
Solution n 4 20n 2 + 4 = (n 4 4n 2 + 4) 16n 2
= (n 2 2)2 16n 2
= (n 2 4n 2)(n 2 + 4n 2) (i)
Note It can be easily seen that none of the factors n 2 4n 2 ,n 2 + 4n 2 can have the value 1,
whatever integral value n may have. Here four cases arises.
4 28
(i) n 2 4n 2 = 1 n =
2
4 20
(ii) n 4n 2 = 1 n =
2
2
4 28
(iii) n + 4n 2 = 1 n =
2
2
4 20
(iv) n + 4n 2 = 1 n =
2
2
From the above four cases, we find that whatever integral value n may have, n 4 20n 2 + 4 is the
product of the integers n 2 4n 2 and n 2 + 4n 2 neither of which equals 1..

Example 17 Prove that the product of four consecutive natural numbers cannot be a perfect cube.
Solution Consider the product
P = n (n + 1) (n + 2)(n + 3), where n is a natural number.
If possible, that P is a perfect cube = k 3 Two cases arises.
Case I If n is odd. n, (n + 1), (n + 3) are all prime to n + 2
Now, we know that every common divisor of n + p and n + q must divide q p.
36 Indian National Mathematics Olympiad

## n + 2 and n(n + 1)(n + 3) are relatively prime.

Since, their product is a perfect cube, each of them must be a perfect cube.
Since, n 3 < n(n + 1)(n + 3) < (n + 3)3
n(n + 1)(n + 3) = (n + 1)3 or (n + 2)3
As n(n + 1)(n + 3) and (n + 2)3 are relatively prime, so second possibility ruled out.
Also n(n + 1)(n + 3) = (n + 1)3 n = 1. Since P = 24, when n = 1 which is not a perfect
cube. So the possibility n = 1 is also ruled out. So n cannot odd.
Case II If n is even.
Then n + 1 is prime to n, n + 2 and n + 3. Consequently n + 1 is relatively prime to
n(n + 2)(n + 3). Since the product of relatively prime numbers n + 1 and
n(n + 2)(n + 3) is a perfect cube, each of them must be a perfect cube.
n 3 < n(n + 2)(n + 3) < (n + 3)3
n(n + 2)(n + 3) = either (n + 1)3
or (n + 2) since n(n + 2)(n + 3) and n + 1 are relatively prime
3

## First possibility ruled out.

Also n(n + 2)(n + 3) = (n + 2)3 n + 4 = 0 which is out of question. Consequently n
cannot be even.
Thus, we find that the product of 4 consecutive integers cannot be a perfect cube.

Example 18 Find all primes p for which the quotient ( 2p 1 1)| p is a square.
Solution Suppose m (m + 1) = 7n 2, m and n are integers since m and m + 1are relatively prime.
m and m + 1 must be the numbers 7p 2, q 2
(in some order) p and q are relatively prime and pq = n; Since the product of 2
consecutive integer is even.
m(m + 1) is even, which means that one of the numbers m, m + 1 must be even.
Suppose m = q 2 (so that m + 1 = 7p 2 ). Since every square number is of one of the
forms 4k , 4k + 1. Consequently m + 1 must be of one of the forms 4k + 1, 4k + 2.
However this is not possible for if p is even, then 7p 2 is of the form 4k. If p is odd,
then 7p 2 is of the form 4k + 3.
m + 1 7p 2. So m = 7p 2 and m + 1 = q 2

## Concept of Finding Number of Positive Integral Solutions for

the Equation of the Form x2 + y2 = k
We know that,
(2n )2 0 mod 4
and ( 2n + 1)2 1 mod 4
Now, if
(a) x and y are both even then,
x 2 + y 2 0 mod 4
(b) x and y are both odd then,
x 2 + y 2 2 mod 4
Theory of Numbers 37

## (c) one is even and other is odd then,

x 2 + y 2 1 mod 4
{x 2 + y 2 0, 1, 2 mod 4 and x 2 + y 2
/ 3 and 4}

## the above discussion implies, if

x 2 + y2 = k
and if k is of the form of (4m + 3), then x 2 + y 2 = k does not have any integral solution.
e.g., suppose, we are asked to find integral solution for equation
x 2 + y 2 = 19, then it will not have any integral solution because 19 is of the form (4m + 3).
Now, if we have x 4 + y 4 = k , then we know that
(2n )4 0 mod 16 and (2n + 1)4 1 mod 16
Again, if (a) x and y are both even then,
x 4 + y 4 0 mod 16
(b) x and y are both odd then,
x 4 + y 4 2 mod 16
(c) one is even and other is odd, then
x 4 + y 4 1 mod 16
x 4 + y 4 0, 1, 2 mod 16
and x 4 + y4
/ i mod 16,
where i = (3, 4, 5, .. , 15)
So, the above discussion implies, if
x 4 + y4 = k
and k is of the form (16m + i ), where i = 3, 4, 5, K , 15, then x 4 + y 4 = k will not have any integral solution.
e.g., suppose we are asked to find integral solutions for equation.
x 4 + y 4 = 16003, then it will not give any integral solution because 16003 is of the form (16m + 3).
The concept can be extended to more than two variables expression, suppose the equation is
x 14 + x 24 + x 34 + x 44 + ... + x 14
4
= 1599
now, we know that
(2n )4 0 mod 16
and (2n + 1)4 1 mod 16
14
x i4 0, 1, 2 K 14 mod 16
i =1

## but our RHS is 1599 15 mod 16.

No integral solution can be obtained for the above equation.

Reason
[If all the variables are considered to be odd, then maximum remainder which can come out is 14 and if
any of the variable is an even number then remainder will be less than 14.]
Now, let us consider another discussion.
If we have a 2 + b 2 + c 2 = a 2b 2
we know, ( 2n )2 0 mod 4 and ( 2n + 1)2 1 mod 4
38 Indian National Mathematics Olympiad

## Case I If a, b and c all are odd then,

a 2 + b 2 + c 2 3 mod 4
whereas a 2b 2 1 mod 4.
It will never give an equality, so the given equation has no integral solution.
Case II If two numbers are odd and one is even, then
a 2 + b 2 + c 2 2 mod 4
whereas a 2b 2 0, 1 mod 4
Again we get no integral solution.
Case III If two even and one odd.
a 2 + b 2 + c 2 1 mod 4
whereas a 2b 2 0 mod 4
Again, no integral solution
Case IV If all are even then
a 2 + b 2 + c 2 0 mod 4
whereas a 2b 2 0 mod 4
Now, there is a possibility to have a solution and the only possible solution is (0, 0, 0) which is the only
trivial solution.
Now, let us come again to the discussion of
x 2 + y2 = k
we have seen, if k = 4m + 3 there is no integral solution now, if k is even then it will be either of the form
k = 4m
or k = 4m + 2
considering k = 4m
If m can be expressed as i 2 + j 2 , where i and j are non-negative integers such that
(i) i j , then there will be four integral solutions and 8 ordered pairs.
(ii) if i = j or m can be written as i 2 + 02, then there will be two integral solutions and 4 ordered pairs.
Let us consider some examples.
e.g., x 2 + y 2 = 20
here, 20 is of the form 4(5) and 5 can be expressed as 5 = 12 + 22 which gives i = 1 and j = 2 so, it implies
there are 4 integral solutions, which will be of the form 2i and 2j also we have 8 ordered pairs.
Therefore in this case we have (2, 4) as one of the solutions and other solutions are
(2, 4), (2, 4), and (2, 4) also (4, 2), (4, 2), (4, 2) and (4, 2) keep this thing in mind there are only 4
integers used.
e.g., x 2 + y2 = 8
Here, 8 = 4(2)
and 2 = 12 + 12
which gives i = j .
So, it implies there are 2 integral solutions which will be of the form 2i and 2j also we have 4 ordered
pairs therefore in this case we have our solutions are
(2, 2), (2, 2), (2, 2) and (2, 2)
keep this thing in mind there are only 2 integers used.
Theory of Numbers 39

e.g., x 2 + y2 = 4
Here, 4 = 4(1)
and 1 = 12 + 02
which gives i = 1 and j = 0
So, it implies there are 2 integral solutions, which are of the form 2i and 2j also we have 4 ordered pairs.
Therefore in this case the solutions are
( 2, 0), (2, 0), (0, 2) and (0, 2).
e.g., x 2 + y 2 = 24
Here, 24 = 4 6
and 6 can't be represented as i 2 + j 2 so it will not have any integral solution.
e.g., x 2 + y 2 = 12
Here, 12 = 4 3
and 3 again can't be expressed as i 2 + j 2 so it will also not have any integral solution.
Now, considering k = 4m + 2 and if m can be written as (i 2 + j 2 + i + j ) and if i j , then these will be
4 integers and 8 ordered pairs of solutions.
And if i = j , then there will be 2 integers and 4 ordered pairs of solutions.
e.g., x 2 + y 2 = 10
Here, 10 = 4 ( 2) + 2
and 2 = (1)2 + (0)2 + (1) + (0)
Therefore there will be four integral solutions which will be given as (2i + 1) and (2 j + 1) and in this
case the solutions are 3 and 1 which will give eight ordered pairs as (3, 1), (3, 1), (3, 1) and (3, 1)
also (1, 3), (1, 3), (1, 3) and (1, 3).
e.g., x 2 + y2 = 2
Here, 2 = 4 (0) + 2
and 0 = (0)2 + (0)2 + (0) + (0)
Therefore there are only two integral solutions which will again be given as ( 2i + 1) and ( 2 j + 1)
and in this case the solutions are 1 and 1, which will give four ordered pairs as (1, 1), (1, 1), (1, 1) and
(1, 1).
e.g., x 2 + y 2 = 18
Here, 18 = 4 (4) + 2
and 4 = (1)2 + (1)2 + (1) + (1)
So i = 1 and j = 1
i = j
Therefore it will have 2 integral solutions which will be given as ( 2i + 1) and ( 2 j + 1) and in this case
the solutions are 3 and 3 which gives four ordered pairs as
( 3, 3), ( 3, 3), (3, 3) and (3, 3)
e.g., x 2 + y 2 = 14
Here, 14 = 4 (3) + 2
and 3 can't be expressed as (i 2 + j 2 + i + j ) as it is always an even number and an even number can't be
equal to an odd number. So it implies if right hand side is (4m + 2) and m is an odd number. So the
equation will never produce any integral solution.
Now, we will extend this concept for an odd number in right hand side of the equation.
40 Indian National Mathematics Olympiad

x 2 + y2 = k
i.e., k = 4m + 1
or k = 4m + 3
As it has been already discussed (k = 4m + 3) will not produce any integral solutions.
So, considering k = 4m + 1, only.
If m = i 2 + j 2 + j,
then there will be an odd integer and an even integer, if i 0 and j 0 or i 0 and j = 0 , then there are
four integers and 8 ordered pairs which will satisfy the equation.
So, one of the integral solution is 2i and other is ( 2 j + 1).
Now, if i = 0, j 0, then there are two integers and four ordered pairs which will satisfy the equations.
So, one of the integral solution is 0 and other is ( 2 j + 1) .
e.g., x 2 + y 2 = 21
Here, 21 = 4 5 + 1
But 5 cannot be written as i 2 + j 2 + j , so it will not give any integral solution.

Exceptional case :
If x 2 + y2 = k
and k is an odd and a perfect square, then perform the following test always.
Take square root of k, which will come out to be as k, now subtract 1 from it we get ( k 1) always
double it, so it becomes 2( k 1), now add 1 to it which becomes 2( k 1). If this value is a perfect
square say, it is a 2 , then the equation will always have 6 integers and 12 ordered pairs as its solutions
and the integers will be a , ( k 1), k and 0. Always keep this thing in mind k is an integer.
And if the test fails, then equation will be solved by the method discussed earlier.
e.g., x 2 + y 2 = 169
here 169 = 4(42) + 1, which is of the form (4m + 1) and also it is an odd perfect square so we will have to
perform the mentioned test.
e.g., 169 = 13
13 1 = 12
12 2 = 24
24 + 1 = 25
and 25 = 52
we will have 4 integers in which 5, 12, will form 8 ordered pairs (5, 12), (5, 12), (5, 12), (5, 12), (12, 5),
(12, 5), (12, 5), (12, 5) also there will be three 13, 0 which will form four pairs (13, 0),(13, 0), (0, 13),
(0, 13)
e.g., x 2 + y 2 = 49
here 49 = 4 12 + 1, which is of the form (4m + 1) and also an odd perfect, so we will again perform the
mentioned test.
49 = 7
71= 6
6 2 = 12
12 + 1 = 13
but 13 is not a perfect square therefore the solution will be checked by the earlier method.
12 = (0)2 + (3)2 + (3)
Here, i = 0 and j = 3
so the solutions will be 0 and 7. Also the ordered pairs will be (0, 7), (0, 7), (7, 0) and (7, 0)
Theory of Numbers 41

## Concept Solving of the equation of the form xy = n.

If we are asked to find the number of positive integral solution for xy = n, we first write n is the form

p1 1 . p 2 2 . p3 3 . The number of positive integral solution is same as the number of divisors of n which is
equal to (1 + 1)( 2 + 1)(3 + 1)
Let us consider example xy = 8 = 23
Number of divisors of 8 are 3 + 1 = 4. So there are 4 integral solution and 4 ordered pair namely (1, 8)
(8, 1) (2, 4) (4, 2)
Now let us consider another example xy = 72(x + y )
we can write it as (x 72)( y 72) = 722.
Let x 72 = X , y 72 = 722
XY = 722 = 26.34
Number of solutions are 35.
A
Concept The area of a formed by pythogorean triplet with
integer sides is always divisible by 3.
1
Area of ABC = BC AB
2 k2 + 1
1
= 2x (x 2 1)
2 k2 1
= (x x )
3

Let p (x ) = x 3 x
B C
2k
For x > 1 we use induction
p(2) = 8 2 = 6 , p(2) is true
Let p (x ) be true for n = m
p (m ) = m3 m = 3c
p (m + 1) = (m + 1)3 (m + 1)
= (m + 1)3 (m + 1) = m3 + 3m 2 + 2m
= 3c + m + 3m 2 + 2m = 3(c + m + m 2 )
P (m + 1) is true.
Concept The radius of the circumcircle of a formed by pythogorean A
triplet cannot be integer.
The hypotenuse of the ABC is the diameter of the circle.
Let us consider the pythogorean triplet x 2 1, 2x , x 2 + 1
Here x 2 + 1 is hypotenuse. Since x is an even number its square is also even,
therefore an even number plus one is an odd number.
x 2 + 1 is an odd number B C
x2 + 1
Radius of circumcircle is
2
Concept For any natural number x for
x = 0, 1, 2, ... , n
2n + 1, 2x (22x 2x 1), 2x (22n 2x
+ 1)
2n 2x
AC = [2 (2
2 x
+ 1)]
2
42 Indian National Mathematics Olympiad

4x 2x + 1
= 22x (24n + 22n + 1) C
4 x + 2x
= (24n + 22n 2x + 1 + 2x + 22x )
2x +1
AC 2 = (24n + 22n + 2 2x )
2x +1 2
2x(22n2x + 1) 2x + 1
AB 2 + BC 2 = [22x (22n 1)2 ] + (2n )
4x 2x + 2
= 22x (24n 2 22n + 1) + 22n
2x
= 2 4n + 22x + 22n 22 22n 2
2x A 2x (22n2x 1) B
= 2 4n + 22x + 4 22n 22
. 2n
2x
= 2 4n + 22x + 22
. 2n
2x +1
= 2 4n + 22x + 22n

Example 1 Prove that there are no natural numbers, which are solutions of15x 2 7y 2 = 9.
Solution 15x 2 9 = 7y 2
3( 5x 2 3) = 7y 2
7y 2 is a multiple of 3.
y is a multiple of 3.
Let y = 3z
3( 5x 2 3) = 7 9z 2
5x 2 3 = 21z 2
5x 2 = 21z 2 + 3
5x 2 is a multiple of 3.
x is a multiple of 3
Let x = 3u
15u 2 = 1 + 7z 2
15u 6z 2 = 1 + z 2
2

1 + z 2 is a multiple of 3.
But for any z between 0 to 9, 1 + z 2 is not a multiple of 3.
For any z, the given equation has no integral solution.
Aliter
Since RHS is odd, x and y must be opposite
i.e., one even and one odd.
As 3|15 and 3|9
3 must divide 7y 2.

## Again, since 3 divide 21 so 3 must divide 5x 2.

Let x = 3x 1 , we get
15x 12 7y12 = 1

15x 12 = 7y12 + 1
Theory of Numbers 43

## Last digit of perfect square y12 may be one of these values 0, 1, 4, 9, 6, 5.

Hence, last digit of 7y12 + 1 will be 1, 8, 9, 4, 3, 6 respectively.
But 15x 12 ends in 0 or 5.
15x 12 = 7y12 + 1 has no solutions.

## Example 2 Show that x 2 + 1 = 3y has no solutions in integers.

Solution Since LHS cannot be a multiple of 3 for any x between 0 to 9.
RHS is always a multiple of 3.
x 2 + 1 = 3y has no integral solutions.

## Example 3 Show that 21x 2 10y 2 = 9 has no solution.

Solution 21x 2 9 = 10y 2
3 (7x 2 3) = 10y 2
10y 2 is a multiple of 3.
y is a multiple of 3.
Let y = 3y1
3 (7x 3) = 10 9y12
2

7x 2 3 = 30y12
7x 2 = 3 + 30y12 7x 2 = 3 (1 + 10y12 )
7x 2 is a multiple of 3
So, x is multiple of 3.
Let x = 3x1
7 9x12 = 3 (1 + 10y12 )
21 x12 = 1 + 10y12
21 x12 9y12 = 1 + y12
3 (7x12 3y12 ) = 1 + y12
1 + y12 is a multiple of 3.
But 1 + y12 is not a multiple of 3.
The given equation has no integral solution.
Note Every integer m can be written in the form x 2 + y 2 5z 2.
If m = 2n, then
= 2n = (n 2)2 + ( 2n 1)2 5(n 1)2
If m = 2n + 1 = (n + 1)2 + ( 2n )2 5n 2
Verification,
7 = 2( 3) + 1 = ( 3 + 1)2 + ( 2 3)2 5( 3)2
= 16 + 36 45
= 52 45 = 7
Similarly, every integer can be written in the form of
x 2 + y 2 + z 2 5u 2
44 Indian National Mathematics Olympiad

1 2n
Example 4 Prove Cn is an integer.
n +1

## Solution If a and b are integers and a b = c, then c is also an integer.

Let a= 2n
Cn ; b = 2n
Cn 1
2n ! 2n ! 2n ! n
2n
Cn 2n
Cn 1 = = 1

n ! n ! (n + 1)!(n 1)! n ! n ! n + 1
1
2n !
= n + 1 it is an integer.

n !n !
(kn )! kn !
kn
Cn knCn 1 =
(kn n )! n ! (kn n + 1)!(n 1)!
(kn )! (kn n )! n !
= 1
(kn n )! n ! (kn n + 1)!(n 1)!
(kn )! n
= 1 kn n + 1
(kn n )! n !
kn n + 1 n kn kn 2n + 1
= knCn = Cn kn n + 1 .
kn n + 1
It is an integer.

## Example 5 If xy = 22 34 57( x + y ) , find the number of integral solution.

Solution Let N = 22 34 57
xy = N( x + y )
xy = Nx + Ny
xy Nx Ny = 0
( x N )( y N ) = N 2
( x N )( y N ) = 24.38.514
Number of integral solution
= ( 4 + 1)( 8 + 1)(14 + 1) = 5 9 15 = 675

## Example 6 Find all positive integers x, y satisfying

1 1 1
+ =
x y 20
Solution Suppose x, y are two positive integers such that
1 1 1
+ = (i)
x y 20
1 1 1 x 20
then = =
y 20 x 20 x
1 x + 20 4 5x
=
y 20x
Implying that 5x is rational.
Theory of Numbers 45

## Now x N 5x N. Hence 5x is the square of an integer which is divisible by 5.

5x = ( 5a )2 for some a N i.e., x = 5a 2 similarly y = 5b 2 for some b N.
Now, Eq. (i) becomes
1 1 1
+ = 2(a + b ) = ab
a b 2
(a 2)(b 2) = 4
(a, b ) {( 3, 6), ( 4, 4), ( 6, 3)}.
Solution set is {(45, 180), (80, 80), (180, 45)}.

Example 7 Find the number of solutions in positive integers of the equation 3x + 5y = 1008.
Solution Let x , y N such that 3x + 5y = 1008 then 3 | 5y 3|y y = 3k for some k N
Now, 3x + 15k = 1008
x + 5k = 336
5k 335
k 67
Thus, any solution pair is given by ( x , y ) = ( 336 5k , 3k ) where 1 k 67.
Number of solutions is 67.

## Example 8 Prove that there do not exist positive integrs x , y , z satisfying

2xz = y 2 and x + z = 997.
Solution 2|y 2 4|2xz 2|x or z 2|x and z [Q 2 | ( x + z )]
Let x = 2x1, y = 2y1 and z = 2z1
Then 2x1z1 = y12 and x1 + z1 = 997
Again y1 and one of x1, z1, say x1, are even writing x1 = 2x 2 and y1 = 2y 2
We have x 2z1 = y 22 and 2x 2 + z1 = 997
Since, 997 is a prime, x 2 and z1 are relatively prime.
Each is a square since their product is square.
Since any square is of the form 8n, 8n + 1 or 8n + 4, 2x 2 0 or 2(mod 8) and z1 1
(mod 8) (Q z1 is odd).
Hence 2x 2 + z1 1 or 3 (mod 8).
A contradiction as 997 5 (mod 8).

## Example 9 Show that the equation 3x 10 y 10 = 1991 has no integral solution.

Solution Suppose the existence of x , y Z such that 3x 10 y 10 = 1991. Note that 11|1991.
Neither x nor y is divisible by 11 for otherwise 11 would divide both .
1110|3x 10 y 10 = 1110|1991
an impossibility.
Hence x and y are prime to 11.
x 10 y 10 1 (mod 11)
1991 = 3x 10 y 10 3 1 = 2 a contradiction.
46 Indian National Mathematics Olympiad

## Example 10 Find all integral solutions of

x 4 + y 4 + z 4 t 4 = 1991
Solution Let n be any integer ; when it is odd n 4 1 = (n 1)(n + 1)(n 2 + 1) is divisible by 16 as
n 1, n + 1, n 2 + 1 are all even and n 1,n + 1being consecutive even integers one of
them is divisible by 4 . When n is even n 4 0 (mod 16).
Thus, n 4 0 or 1, Now for any x , y , z , t , Z
x4 + y4 + z4 t4
where {1, 0, 1, 2, 3}, since 1991 7
x 4 + y 4 + z 4 t 4 1991

Example 11 For n N, let s(n) denote the number of ordered pairs ( x , y ) of positive integers for
1 1 1
+ = . Determine the set of positive integers n for which s(n ) = 5 .
which
x y n
1 1 1
Solution + = x, y > n
x y n
x = n + a and n + b, a, b N.
1 1 1
Now, + =
n+a n+b n
(n + b + n + a )n = (n + a )(n + b )
n 2 = ab
s(n ) is the number of divisors of n 2

Let n = p1 1 K pmm be prime factorization of n where 1 K m .
Then s(n ) = (1 + 2 1) K (1 + 2 m )
s(n ) = 5
1 + 2 1 = 5
and m =1
n = p12
Required set is {p 2 : p is prime}.

1 1 1
Example 12 If + = ;a, b, c are positive integers with no common factors. Prove that (a + b ) is a
a b c
square.
a+b 1
Solution By the hypothesis =
ab c
i.e., (a + b )c = ab
Let p be any prime which divides (a + b ); then p divides one of a, b and therefore
both.
Since gcd (a, b, c ) = 1; p does not divide c.
for any k N, pk | a pk | b
Hence the maximum power of p which divides a + b is the square of the maximum
power of p which divides a.
a + b is a square.
Theory of Numbers 47

3n 5
Example 13 Find all integers n such that is also an integer.
n +1
3n 5 8
Solution Since, = 3 is an integer.
n +1 n +1
8
{ 1, 2, 4, 8}
n +1
8
and 3 is a square.
n +1
8
Consequently = 1 or 2 ;
n +1
i.e., n = 9 or 3

## Example 14 Find the number of pairs of integers (a, b ) such that

a 3 + a 2b + ab 2 + b 3 + 1 = 2002.
Solution a 3 + a 2b + ab 2 + b 3
= (a + b ) (a 2 + b 2 ) = 2001
= 3 23 29
a + b is therefore one of the three numbers 3, 23, or 29.
If a + b = 3, then a = 1, b = 2
(or a = 2, b = 1) so that a 2 + b 2 = 5.
But in this case a 2 + b 2 = 23 29
a + b is not 3.
If a + b = 23, then a 2 + b 2 = 87
so that both a and b will be less than 10 and a + b < 20, a contradiction.
If a + b = 29, then a 2 + b 2 = 69 so that both a and b will be less than 10 and
a + b < 20, a contradication.
Thus, the number of pairs (a, b ) satisfying the given condition is zero.