A palindrome is a positive integer that is the same when its digits are read forwards or backwards. For example, 7,828 and 3141413 are all palindromes. How many 7-digit palindromes are multiples of 4 ?
A computer code written in C++ finds that there are:
9,000 7-digit palindromes
Of the above 9,000 palindromes:
2,000 of them are multiples of 4
possible last 2 digits(divisibility rule for four):
00
04
08
12
16
20
24
28
32
36
40
44
48
52
56
60
64
68
72
76
80
84
88
92
96
25 possibilities. Out of these, the ones ending with 0 don't work. (Can you see why?)
So, 00, 20, 40, 60, and 80 don't work.
20 possibilities.
I think this is the right decision
possible last 2 digits(divisibility rule for four):
00
04
08
12
16
20
24
28
32
36
40
44
48
52
56
60
64
68
72
76
80
84
88
92
96
25 possibilities. Out of these, the ones ending with 0 don't work. (Can you see why?)
So, 00, 20, 40, 60, and 80 don't work.
20 possibilities.
I know the divisibilty rules. i just don't understand how to include the palindrome part of the question
Answer #3, #2 pretty much gets you there.
There are 20 possibilities for the final two digits and that will fix the first two digits as well.
For the middle three digits, there are 10 possibilities for the middle digit and 10 for the (identical) digit either side of that, so 10*10=100 possibles.
Put those together and you have 20*100 = 2000 possible 7 digit palindromes, (as was stated in #1).