To write the problem in somewhat mathematical terms, we have three digits $d_1 \in \{1, \dots, 9\}$, $d_2,d_3 \in \{0, 1, \dots, 9\}$ that form a $3$-digit number
$$x = d_1 \cdot 10^2 + d_2 \cdot 10 + d_3$$
Now, we want to find all possible values of $x$ such that at least one of the following holds:
- $d_1 + d_2 = d_3$,
- $d_1 + d_3 = d_2$,
- $d_2 + d_3 = d_1$
Let's start with the first condition. We may pick $d_1$ freely, which gives us $9$ options. However, since $d_3 \in \{0, 1, \dots, 9\}$, we must always choose $d_2 \in \{0, \dots, 9-d_1\}$. Hence:
$$\# \{ x \mid d_1 + d_2 = d_3\} = \sum_{d_i = 1}^{9}(10-d_i) = 45$$
The same reasoning holds for the second condition:
$$\# \{ x \mid d_1 + d_3 = d_2\} = \sum_{d_i = 1}^{9}(10-d_i) = 45$$
However, the last condition is different! We pick $d_2$ freely which gives us $10$ options, and we must choose $d_3 \in \{0, \dots, 9-d_2\}$. However, we also have to exclude one case: $d_2 = d_3 = 0$, because then $d_1$ would also be $0$. Hence:
$$\# \{ x \mid d_2 + d_3 = d_1\} = \sum_{d_i = 0}^{9}(10-d_i)-1 = 54$$
We now have $45 + 45 + 54 = 144$ numbers $x$ such that either of the conditions hold. However, some numbers are counted twice. It is easy to see that a number is counted twice if and only if $d_i = d_j$ and $d_k = 0$ for $i,j,k$ being some permutation of $1,2,3$. Since $d_1 \neq 0$, the multiples we need to discard are those of the form $d_2 = 0$ or $d_3 = 0$. There are $9$ of each ($d0d$ and $dd0$ with $d = 1, \dots, 9$), so we remove $18$ multiples. There is no number for which all $3$ conditions hold, since that would require $d_1 = d_2 = d_3 = 0$.
The solution is then:
$$\#\{x\} = 144- 18 = 126.$$
Hint : Since all the digits have to be even, any possible number is divisible
by $8$, if and only if the last two digits form a number divisible by $8$.
Best Answer
We'll find sums at each place (units, tens, etc.) and add them.
At thousands place each of $1,2,3$ occurs $6$ times. Sum is $6(1+2+3)\cdot 1000=36000$.
For hundreds place, we first look at numbers with thousands digit $1$. These are six numbers in which each of $2,3,0$ occurs twice. Hence in the $18$ nos, each of $1,2,3$ occurs $4$ times while $0$ occurs $18-3\cdot 4=6$ times as expected. Sum at hundreds place is $4(1+2+3)\cdot 100=2400$.
Sum at tens and units places are similar - $240$ and $24$ respectively.
Desired sum is $36000+2400+240+24=38664$.
The repetition case is exactly similar and probably easier.
We have $3\cdot 4^3$ nos in all, with $4^3$ starting with $1,2,3$ each. Sum at thousands place is $4^3(1+2+3)\cdot 1000$
For hundreds place, lets fix any digit as $$\square \, 0 \, \square \, \square$$ There'll be $3\cdot 4^2=48$ occurences of the fixed digit. Thus sum at hundreds place is $48(0+1+2+3)\cdot 100$.
Similarly at tens and units place - $48(0+1+2+3)\cdot 10$ and $48(0+1+2+3)\cdot 1$ resp.
Desired sum is $$(1+2+3)(64000 + 48\cdot 111) = 415968$$