Example 1. Using only the digits 2, 3 and 9, how many six digit numbers can be formed which are divisible by 6?
Example 2. When the product of four consecutive odd positive integers is divided by 5, find the set of remainder(s).
Example 3. Consider the equation x2 + y2 = 2015 where x ≥ 0 and y ≥ 0. How many solutions (x, y) exist such that both x and y are non-negative integers?
Of course, you can find the solution just below, but it is highly recommended that, you first try to solve it on your own.
Just remember the words of Paul Halmos, who says “the only way to learn mathematics is to do mathematics”.
Solution 1. Let the number be n = abcdef. Each entry can take three possible values: 2, 3 and 9 independently. So, there are 36 such numbers in all.
But we want only those numbers which are (i.e., n) divisible by 6. This is equivalent to n being divisible by both 2 and 3.
For n to be divisible by 2, f must be even and hence 2 is the only possible value. The second requirement implies that the sum a + b + c + d + e + f is divisible by 3.
As 3 and 9 are each divisible by 3 and f = 2, there are only two possibilities for n to be divisible by 3:
(i) exactly two of a, b, c, d and e are 2; and
(ii) all five of them are 2.
When (i) holds, the remaining three places can be filled by 3 and 9 in 23 = 8 ways. So there are
numbers of type (i). There is only one number, viz. 222222 of type (ii).
So the total count is 80 + 1 = 81.
Solution 2. Simplicity of the solution depends on the choice of the four consecutive odd numbers.
Let the four consecutive odd numbers be 2m – 3, 2m – 1, 2m + 1 and 2m + 3. So, if we denote the product by P, we have
P = (2m − 3)(2m − 1)(2m + 1)(2m + 3) (1)
= (2m − 3) (2m + 3)(2m − 1)(2m + 1)
= (4m2 − 1)(4m2 − 9)
= 16m4 − 40m2 + 9 (2)
Case 1. When at least one of these four integers is divisible by 5. Then, P is also divisible by 5, using (1). Hence remainder is 0, in this case.
Case 2. Let m = 5k for some integer k. Putting this into (2), we get
P = 16(5k)4 – 40(5k)2 + 9
= 10000k4 – 1000k2 + 5 + 4
= 5(2000k4 – 200k2 + 1) + 4,
showing that P leaves the remainder 4 when divided by 5.
Hence the possible remainders are 0 and 4.
Solution 3. In the present problem, the question is to see in how many ways 2015 can be expressed as a sum of squares of two non-negative integers x and y. Since 2015 is an odd integer, following possible cases need to consider:
Case 1. The possibilities where either x or y is 0 are ruled out, as 2015 is not a perfect square.
Case 2. Let x and y both be even numbers. This case is not possible as the sum of the squares of two even numbers cannot be odd.
Case 3. Let one of x and y is even and the other is odd. Suppose, without loss of generality that x = 2m and y = 2n + 1 for some integers m, n. Then the given equation transforms to
(2m)2 + (2n + 1)2 = 2015
or, 4m2 + 4n2 + 4n + 1 = 2015
or, 4(m2 + n2 + n) = 2014
Clearly, the L.H.S. is divisible by 4 while the R.H.S. is not. Hence the given equation has no solutions.