Bunuel wrote:
Three digit numbers in which the middle one is a perfect square are formed using the digits 1 to 9. What is the sum of all such numbers?
(A) 134,055
(B) 160,540
(C) 170,055
(D) 270,540
(E) 280,540
Are You Up For the Challenge: 700 Level Questions: 700 Level Questions Solution:
We see that the middle digit of the number can be 1, 4, or 9. Since the first digit and last digit of the number can be any of 9 digits (from 1 to 9) and the middle digit can be one of the 3 digits (1, 4 or 9), there are 9 x 3 x 9 = 243 such numbers. So the question is what is the sum of these 243 numbers?
Of these 243 numbers, 81 have 1 as the middle digit, another 81 have 4 and remaining 81 have 9. Now, let’s look at the 81 that have 1 as the middle digit first. The digit 1 as the first digit will appear 9 times (since the last digit can be any of the digits from 1 to 9); we can apply the same analogy for the digit 2, 3, etc. as the first digit. Therefore, the sum of these 81 numbers is:
(1 x 100 x 9 + 2 x 100 x 9 + … + 9 x 100 x 9) + (1 x 10 x 81) + (1 x 1 x 9 + 2 x 1 x 9 + … + 9 x 1 x 9)
In the above sum, the first, second and third groups are the total values of the hundreds, tens and ones digits of the 81 numbers, respectively. Therefore, it’s the sum of the 81 numbers. In each group, we can see that each addend is in the form or A x B x C, where A is the digit, B is its place value and C is the number of times it appears. Now let’s simplify the expression and find its value.
(1 + 2 + … + 9) x 900 + 810 + (1 + 2 + … + 9) x 9
= 45 x 900 + 810 + 45 x 9
= 41,715
Using the same analogy, we can see that the sum of the 81 numbers that have 4 as the middle digit is:
(1 x 100 x 9 + 2 x 100 x 9 + … + 9 x 100 x 9) + (4 x 10 x 81) + (1 x 1 x 9 + 2 x 1 x 9 + … + 9 x 1 x 9)
However, we will argue that this is 3 x 10 x 81 = 2,430 more than the sum of the 81 numbers that have 1 as the middle digit. Therefore, the sum is 41,715 + 2,430 = 44,145.
Finally, the sum of the 81 numbers that have 9 as the middle digit is:
(1 x 100 x 9 + 2 x 100 x 9 + … + 9 x 100 x 9) + (9 x 10 x 81) + (1 x 1 x 9 + 2 x 1 x 9 + … + 9 x 1 x 9)
Again, we will argue that that is 8 x 10 x 81 = 6,480 more than the sum of the 81 numbers that have 1 as the middle digit. Therefore, the sum is 41,715 + 6,480 = 48,195.
Now, adding these 3 sums, we will have 41,715 + 44,145 + 48,195 = 134,055 as the sum of the 243 three-digit numbers that have 1, 4, or 9 as the middle digit.
Answer: A