How many four-digit numbers divisible by 15 contain the digits 4 and 7 next to each other (as '47' or as '74')?
Answer and solution
Correct answer: 22
Solution
1. Divisible by 15 means divisible by 5 and 3: last digit 0 or 5, and digit sum a multiple of 3.
2. '47' in positions 1-2 ($47cd$): digit sum $11 + c + d$, so $c + d \equiv 1 \pmod 3$. With $d = 0$: $c = 1, 4, 7$; with $d = 5$: $c = 2, 5, 8$. That gives 6 numbers.
3. '47' in positions 2-3 ($a47d$): $a + d \equiv 1 \pmod 3$ with $a \ge 1$. With $d = 0$: $a = 1, 4, 7$; with $d = 5$: $a = 2, 5, 8$. Again 6 numbers.
4. '47' in positions 3-4 ends in 7, so it cannot be divisible by 5: 0 numbers. Total with '47' $= 12$.
5. By the same working, '74' also gives 12 numbers.
6. Numbers having both '47' and '74' are 4740 and 7470 (counted twice). Total $= 12 + 12 - 2 = 22$.
Quick check: A direct list of all multiples of 15 from 1000 to 9999 confirms 12 with '47', 12 with '74' and 22 with either.
Answer: 22
2. '47' in positions 1-2 ($47cd$): digit sum $11 + c + d$, so $c + d \equiv 1 \pmod 3$. With $d = 0$: $c = 1, 4, 7$; with $d = 5$: $c = 2, 5, 8$. That gives 6 numbers.
3. '47' in positions 2-3 ($a47d$): $a + d \equiv 1 \pmod 3$ with $a \ge 1$. With $d = 0$: $a = 1, 4, 7$; with $d = 5$: $a = 2, 5, 8$. Again 6 numbers.
4. '47' in positions 3-4 ends in 7, so it cannot be divisible by 5: 0 numbers. Total with '47' $= 12$.
5. By the same working, '74' also gives 12 numbers.
6. Numbers having both '47' and '74' are 4740 and 7470 (counted twice). Total $= 12 + 12 - 2 = 22$.
Quick check: A direct list of all multiples of 15 from 1000 to 9999 confirms 12 with '47', 12 with '74' and 22 with either.
Answer: 22