Four digit number formed by $2,3,5,7,9$ without repetition, has remainder of $2$ when divided by $3$ or $5$. A four digit number is formed using $2,3,5,7$ or $9$ without repeating any of the digits. How many four digit number are there if each number has a remainder of $2$ when divided by either $3$ or $5$?
Hi, for my personal understanding, I understand that the last number for the four digit should be $2,5$ or $7$ since it must has remainder of $2$ when divided by $5$ or $3$. So the last number will contain three choices? I am not sure whether the answer should be like $(4)(3)(2)(3)$?
 A: Let the number be abcd. 
1) abcd divided by 3 has remainder 2.
So abcd = 1000a + 100b + 10c + d = 999a + 99b + 9c +a + b + c +d has remainder 2 so a + b + c + d has remainder 2.
2 + 3 + 5 + 7 + 9 = 26 = 24 + 2 has remainder 2.
If we subtract 3 or 9 from 26 we will have a remainder of 2.  If we subtract 2, 5, or 7 from 26 we will not. 
So the four digits are either 2, 3, 5 and 7 or 2, 5,7 and 9.  Or in other words the four digits will contain 2, 5, and 7 and either one or the other of 3 or 9.  We will call the four digits 2, 5, 7 and x which can be either 3 or 9.
2) abcd divided by 5 has remainder 2.
So abcd = 10*abc +d will have remainder 2 so d will have remainder 2.
2 and 7 are the only possible choices for d.
So there are 2 possible choices (2 or 7) for d.  There are 3 possible choices for a (Either 5 or x or whichever wasn't chosen for d).  There are 2 possible choices for b (One of the 2 that wasn't chosen for a or d, or the other one of the 2 that wasn't chosen for a or d).  This is 1 possible choice for c (whatever is left).  This is 2*3*2*1 = 12 possible numbers:
2x57; 25x7; x257; x527; 52x7; 5x27; x572; ....etc.
For each of these 12 possibilities x can be either 3 or 9 so there are 12*2 = 24 possible options.
