# How many 5 digit numbers can be formed with the digits 1, 2, 3, 4 and 5 such that they are divisible by 2 but not by 4 or 8?

### 1 Answer | Add Yours

The test for divisibility by 2 is that the last digit should be divisible by 2. A number divisible by 4 has the number formed by the last 2 digits divisible by 4. And the test for divisibility by 8 is that the number formed by the last three digits is divisible by 8.

Now if the number that has to be formed using the given digits is divisible by 2,the last digit is 2 or 4.

If the last digit is 2 and the number is not divisible by 4, the second last digit can only be 4. Also, a number not divisible by 4 is not divisible by 8 either, so this constraint prevents the number from being divisible by either 4 or 8.

Similarly, if the last digit is 4, the second last digit can be 1, 3 or 5.

Using the conditions we have found, the numbers that can be formed are 1*1*3*3*3 + 1*3*3*3*3 = 27+81= 108

**The required number of numbers that can be formed which satisfy the given conditions are 108.**