In how many $4$-digit numbers the sum of two right digits is equal to the sum of two left digits In how many $4$-digit numbers the sum of two right digits is equal to the sum of two left digits.
My attempt:We should find number of two pairs that can be digits of this number for choosing the place of digits we have $*8$ (We should notice we cant have $0$ in the beginning.But the biggest problem is finding such pairs.How can I find them?
 A: First let's not bother with numbers starting with $0$ for now, we can subtract those cases later. Now consider what possible value can the sum $s$ of two digits be? We see that $s \in \{0,1,\dots,18\}$. Let's look at possible ways to get individual values of $s$:
\begin{array}{ccc}
s& &\#\\
0 & 00& 1\\
1 & 10,01&2\\
2 & 20,11,02&3\\
&\vdots\\
9 & 90,81,72,63,54,45,36,27,18,09&10\\
10 & 91,82,73,64,55,46,37,28,19&9\\
11 & 92,83,\dots,29&8\\
&\vdots\\
18 & 99&1\\
\end{array}
Now if we want to get number of $4$-digit numbers where both pair of numbers give sum $s=0$, we have $1\cdot 1$ possibilities ($0000$), for sum $s=1$ we have $2\cdot 2=4$ possibilities ($1010$,$1001$,$0110$,$0101$), etc. So overall we have
$$
1\cdot1+2\cdot2+\dots+10\cdot10+9\cdot9+\dots+1\cdot 1=670.
$$
Now let's subtract those combinations that begin with $0$. By inspecting the table above you can notice there is exactly one such pair that begins with $0$ for each $s\leq 9$. So this gives $1$ possibility for first pair of numbers, and original number of possibilities for second pair of numbers. So we have
$$1\cdot1+1\cdot2+\dots+1\cdot10=55.$$
So there are $55$ $4$-digit numbers that begin with $0$ and satisfy your condition. Now just subtract those to values to get final result:
$$670-55=615.$$
You can simplify the notation a bit by putting this into fancy sums and so, but I think in this case it is unnecessary (perhaps with larger values).
A: Take the number as $a_0a_1a_2a_3$.    

For a sum of two digits $S = a_0 + a_1$, we can see that there are $19-S$ pairs of digits associated with the sum when $S \geq 10$ and $S +1$ pairs of digits otherwise. But, we require that $a_0\neq 0$. So, for the latter case, there are only $S$ digits as for each $S$ there is one combination with zero leading digit.   
We thus take the sum as: $$\sum_{n=1}^{9} n(n+1) +\sum_{n =10}^{18} (19-n)^2 = 615$$ Hope it helps.

P.S: A Turbo C++ code also gives us the result as $615$.
A: This problem can be solved using Stars and Bars method.
Let the digits be $a,b,c,d$.
Then we must find integral solutions of $$a+b=c+d \Rightarrow a+b-c-d=0$$
with restrictions on $a,b,c,d\ $ i.e $1\le a\le 9$ and $0\le \{b,c,d\}\le 9$
The equation can be transformed by taking $a=x_1+1,\ b=x_2,\ c=9-x_3,\ d=9-x_4$ to:
$$\begin{align}&x_1+1+x_2+x_3-9+x_4-9=0\\\Rightarrow \ \ &x_1+x_2+x_3+x_4=17\end{align}$$
with $0\le x_1\le 8$, $0\le \{x_2,x_3,x_4\}\le 9$
The number of integral solutions of above equation can be solved using the Stars and Bars method.
Try yourself or see below for rest of the procedure:

Number of solutions for $$x_1+x_2+x_3+ x_4 = 17\\$$ where $x_i \ge 0$
  for $i = 1,2,3,4$ is $\binom{17+4-1}{17}=\binom{20}{3}$ solutions.
We have to remove cases where $x_1\ge9$ and $\{x_2,x_3,x_4\}\ge10$,
  let's say $x_1$ for example, is $\ge 9$, then we can find all the
  number of solutions to be excluded by putting $y_1 = x_1 - 9$, we can
  write $$y_1 + x_2 +x_3+x_4 = 8$$ which has
  $\binom{8+4-1}{8}=\binom{11}{3}$ solutions.
Similarly for $x_i\ge 10$ for $i=2,3,4$, then we can find all the
  number of solutions to be excluded by putting $y_i = x_i - 10$, we can
  write, for e.g. $x=2$, $$x_1 + y_2 +x_3+x_4 = 7$$ which has
  $\binom{7+4-1}{8}=\binom{10}{3}$ solutions.

Hence total number of such 4-digit numbers is:
$$\binom{20}{3}-\binom{11}{3}-3\times\binom{10}{3}=615$$
A: The two digit sum $T$ can be a number between $0$ and $18$ (we can worry about zeroes presently). For values of $T$ up to $9$, we can $T$ between digits in $T{+}1$ ways, and for values from $9$ to $18$ we can split them in $18-T+1=19-T$ ways. This applies independently to the first two digits and the last, except that for $T$ values up to $9$, there are only $T$ ways to split the front digit pair due to the need to keep a zero off the front.
So the total looks like $$\sum_{T=0}^9 T(T+1) + \sum_{T=10}^{18} (19-T)^2 = \sum_{T=1}^9 \big((T^2 + T) + T^2\big) \\
= 2\sum_{T=1}^9 T^2 + \sum_{T=1}^9T =  2\cdot \frac{9\cdot 10\cdot 19}{6} + \frac{9\cdot 10}{2} \\
= 570 +  45 = 615$$  
A: The best way to tackle this problem is to think about what the sum of the two rightmost digits is going to be, and then find in how many ways that can be done.
Because we are summing only two 1-digit integers, the biggest sum we can get is with $9+9=18$ so there is no 4-digit number, whose sum of the two right digits gives more than $18$. Likewise it will never be less than $0$ because digits are never negative.
Therefore one can reason separately for all the possible values of the sum. We can start by noticing that for the sum to be $0$, then we must have the number ending with $00$ and starting with $00$ but that is not a valid 4-digit number as it is just $0$.
Suppose that the sum of the two left digits is some number $S$, with $S < 10$. How can you write $S$ as a sum of two 1-digit numbers, $S = a + b$, if $a$ represents the first digit of your number and $b$ the second? Well, the only restrictions are $1 \leq a \leq 9, 0 \leq b \leq 9$. Also, as soon as you fix the value for $a$, the value for $b$ becomes determined: $b = S - a$ hence one can only think of the possible values for $a$. But given that $S < 10$, $a$ can take any value in $1, 2, \cdots, S$. So if the sum is $S, S < 10$, there are $S$ possible arrangements for the left side of the number. What about the right side? Well, using a similar argument, but because the rightmost digit can be $0$, you see there are $S+1$ arrangements for the right hand side. Thus we know that part of our result is $\sum_{S=1}^{9} S(S+1) = 330$.
Now we only need to think about the possible arrangements of the digits if the sum of the two leftmost digits is $10\leq S\leq18$. Because $S$ is too big, $a$ can't be too small, otherwise you can't make $a + b = S$. For example, if $S=15$, you can't have $a = 1$ because $b$ can never be $14$ as it is just a single digit. So what we want to think about is: if I have $S$, what is the minimum value for $a$ that makes it possible for $b$ to be just a single digit?
We have $S = a + b \iff S - b = a$. Because $b$ can't be more than $9$, $a$ can't be less than $S - 9$. So we have $S-9\leq a \leq9$. This means that $a$ has $9 - (S - 9) + 1 = 19 - S$ possible values. After setting $a$, $b$ is determined. So all it takes is to think about the arrangements for the right side. But a similar reasoning shows that this too gives $19 - S$ arrangements when $10 \leq S \leq 18$ so we add another $\sum_{k=10}^{18} (19 - S)^2 = 285$.
Adding everything together, we get $330 + 285 = 615$ which thankfully is in accordance with the other answers.
