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.$$
Let your number be $ABC$,
$A $ can take up values 7,8 and 9 i.e. total 3. Now $B$ has total 4 choices and simultaneously $C$ will have 3.
Thus answer=4*3*3=36
Example: Let $A$=7. Thus $B$ is left with {1,5,8,9}.
Let $B$ be 5. Thus now $C$ is left with {1,8,9}. Clear?
Best Answer
The problem can be transformed into a couple of related problems as follows:
Problem 1: Consider the non-repetition problem with no restriction on range. Here we are to find natural numbers $0\leq a<b<c$ such that: $$a+b+c=20$$ Given appropriate $x,y,z\geq0$ we could reformulate this in the following way: $$ \begin{align} a&=x \\ b&=x+1+y\\ c&=x+1+y+1+z \end{align} $$ so the equation becomes $$ 3x+2(1+y)+1+z=20 \\ \Updownarrow\\ 3x+2y+z=17 $$
Constraint 1: To make use of the results from problem 1, we need to identify the cases where $c\leq 8$. For this to be the case, we must have: $$ c=x+1+y+1+z\leq 8 \\ \Updownarrow \\ x+y+z \leq 6 $$
Solutions 1: In order to search for solutions to problem 1 subject to constraint 1, we can start from a particular solution: $$ (x,y,z)=(5,1,0) \implies (a,b,c) = (5,7,8) $$ and try adding neutral vectors (vectors with $3x+2y+z=0$) such as $(-2,3,0)$ and $(0,-1,2)$ to this in order to produce further solutions. Indeed $$ (5,1,0)+(-2,3,0)=(3,4,0)\implies(a,b,c)=(3,8,9) $$ would have been another solution, had it not been for the constraint $x+y+z\leq 6$. Since adding $(-2,3,0)$ or $(0,-1,2)$ increases $x+y+z$ by one and since $(x,y,z)=(5,1,0)$ already has sum $6$, soon one realizes that this is the only solution. Note that $(-2,3,0)$ and $(0,-1,2)$ form a basis for the nullspace of the problem since the nullspace defined by $3x+2y+z=0$ must be two-dimensional.
Problem 2: Consider the repetition case $0\leq a\leq b\leq c$. This can be described via: $$ \begin{align} a &= x \\ b &= x+y \\ c &= x+y+z \end{align} $$ so we have: $$ 3x+2y+z=20 $$
Constraint 2: Here we have: $$ c=x+y+z\leq 8 $$
Solutions 2: Again we start from a particular solution: $$ (x,y,z) = (6,1,0) \implies(a,b,c)=(6,7,7) $$ Note that $x+y+z=7$ so this is a valid solution. But as soon as we add $(-2,3,0)$ or $(0,-1,2)$ we increase the sum $x+y+z$ by one, so we have very little wiggle room. In fact we can add one of those exactly once, so the only two other solutions must be: $$ \begin{align} (6,1,0)+(-2,3,0) &= (4,4,0) \implies &&(a,b,c)=(4,8,8) \\ (6,1,0)+(0,-1,2) &= (6,0,2) \implies &&(a,b,c)=(6,6,8) \end{align} $$
I hope this makes sense!