How many $3$-digit numbers can be formed so that the sum of two digits will be equal to the third digit? 
How many $3$-digit numbers can be formed so that the sum of two digits will be equal to the third digit?

I am confused in this question whether to take first 2 digits sum or any digit sum such that it is equal to 3rd digit.
For example, some combinations 112 can be written into 3 ways  112 112 121 
such that in the last 
Example 3rd number and first number sum = 2 (middle number).
Also, is there any better approach towards this problem rather than counting and arranging the 3 digit number?
 A: 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.$$
A: Answer is 126.
Where X is first digit (1 through to 9) and y is number of digits use equation below and add answers: 
             y=  2(9-X) + ( 10-(9-X))

eg X=1  2(9-1) + ( 10 - (9-1)) =18
Then working through remaining first digits:   X=2 y=17, X=3 y=16......X=9 y=10
Sum of the Y values is 126  
A: I'm going to assume that the problem means that the sum of any two digits equals the third.
To start, let's find out how many 3 digit numbers have the last digit as the sum of the first two digits:
Here, the first digit cannot be $0$ or $9$.  It can't be $9$ because the sum of $9$ and any digit is a two digit number If the first digit is $1$ then second number can be any digit from $0$ to $8$.  So nine possibilities.  If the first digit is $2$ then the possibities for the second digit is $0$ through $7$.
So, the number of three digit numbers whose first two digits add up to the third is: $9+8+\cdots +1$.
Now, the total of all numbers in which the sum any two digits is 3 times the previous answer because the sum digit could be the first, second or third digit.
