**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 *x*^{2} + *y*^{2} = 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 3^{6} 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 2^{3} = 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 2*m* – 3, 2*m* – 1, 2*m* + 1 and 2*m* + 3. So, if we denote the product by *P*, we have

*P* = (2*m* − 3)(2*m* − 1)(2*m* + 1)(2*m* + 3) (**1**)

= (2*m* − 3) (2*m* + 3)(2*m* − 1)(2*m* + 1)

= (4*m*^{2} − 1)(4*m*^{2} − 9)

= 16*m*^{4} − 40*m*^{2} + 9 (**2**)

Case 1. When at least one of these four integers is divisible by 5. Then,Pis also divisible by 5, using (1). Hence remainder is 0, in this case.

Case 2. Letm= 5kfor some integerk. Putting this into (2), we get

P= 16(5k)^{4}– 40(5k)^{2}+ 9= 10000

k^{4}– 1000k^{2}+ 5 + 4= 5(2000

k^{4}– 200k^{2}+ 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* = 2*m* and *y* = 2*n* + 1 for some integers *m*, *n*. Then the given equation transforms to

(2*m*)^{2} + (2*n* + 1)^{2} = 2015

or, 4*m*^{2} + 4*n*^{2} + 4*n* + 1 = 2015

or, 4(*m*^{2} + *n*^{2} + *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.