[Math] the sum of all 3 digit numbers whose middle digit is a perfect square

combinatoricspermutations

Question: Three digit numbers in which the middle one is a perfect square are formed using the digits $1$ to $9$.Then their sum is?

$A. 134055$
$B.270540$
$C.170055$
D. None Of The Above

Okay, It's pretty obvious that the number is like $XYZ$ where $X,Z\in[1,9] $ and $Y\in\{1,4,9\}$

I'm facing problems in finding a method to evaluate such a sum?

(obviously, I can't afford to use a calculator)

Best Answer

$\overbrace{111,112,...,119}^{\text{$9$ times}} \quad 141,142,...,149 \quad 191,192,...,199$

$211,212,...,219 \quad 241, 242,...,249\quad291, 292,...,299$

$\quad.\quad\quad\quad\quad\quad\quad\quad\quad.\quad\quad\quad\quad\quad\quad\quad\quad.$

$\quad.\quad\quad\quad\quad\quad\quad\quad\quad.\quad\quad\quad\quad\quad\quad\quad\quad.$

$911,912,...,919 \quad 941,942,...,949\quad991,992,...,999$

So we just need to add up the units, tens and hundreds separately.

We have "$9$ rows" and "$9$ columns" in our first grid (numbers with $1$ as the $2$nd digit).

There are $9\cdot (1+2+3+4+5+6+7+8+9)=9\cdot 45=405$ lots of $100$s. There are also $9\cdot 9=81$ lots of $10$s. We can just focus on the units. There are $9$ rows of $1s$, $9$ rows of $2$s,... and $9$ rows of $9$s. So in total we have $9(1+2+3+4+5+6+7+8+9) = 9\cdot 45 = 405$ from summing all the units. The only difference between each grid is the tens unit.

So in the second grid the tens units sum to $4\cdot 81 \cdot 10 = 3240$.

In the third grid the tens units sum to $9\cdot 81 \cdot 10 = 7290$

Then to find the total we add up all the hundreds:

$40500\cdot 3 =121500$

We add up all the units:

$405\cdot 3 = 1215$

Then we add up all the tens

$810+3240+7290=11340$

The total is then given by $T = 121500+1215+11340=134055$

Thus the answer is $A$