He has
32 memory cards in his pocket
Let M be the number of memory cards:
If M is between 1-19 then it could be any number, however
- All numbers 1-19, excluding 5, 10 and 15 for now, are either not multiple of 8 or not multiples of 10 which means it cant be them.
- If it is 5, then it is not a multiple of 8 or 10, which is a contradiction.
- If it is 10, then it is not a multiple of 8 which is a contradiction.
- If it is 15, it is not a multiple of 8 or 10 which is a contradiction.
So we know it's not between 1-19, as all numbers are either not a multiple of 8 or 10.
If M is between 20-29 then it is a not a multiple of 8. Which means that is could be 20, 21, 22, 23, 25, 26, 27, 28 or 29.
- It can't be 20 or 25 as they're a multiple of 5, but not between 1-19.
- It can't be 21, 22, 23, 226, 27, 28 or 29 because they're not multiples of 10 but aren't in 30-39.
So we know it's not between 20-29.
If M is between 30-39, then it's not a multiple of 10. Which means it could be 31-39.
- It can't be 35 because that's a multiple of 5.
- It can't be 31, 33, 34, 35, 36, 37, 38 or 39 as these are not multiples of 8 but aren't in 20-29.
Therefore the only number it can be is
32.
Asas all numbers greater than 39 are
either a multiple of 5, or not a multiple of 8 or 10, which will lead to a contradiction.