# The number of 5-digit numbers of the form abcde where a,b,c,d,e belong to ${0,1,2,...9}$ and $b = a + c$, $d = c + e$ are?

The number of 5-digit numbers of the form abcde where a,b,c,d,e belong to $${0,1,2,...9}$$ and $$b = a + c$$, $$d = c + e$$ are?

I tried to reason out that out of the 5 digits we need to choose only $$3$$, that is $$a,c$$, and $$e$$, while $$b$$ and $$d$$ will become fixed on the basis of those. Now, we also need to satisfy $$a + c ≤ 9$$ and $$c + e ≤ 9$$. Solving the former equation gives us some pairs of $$a$$ and $$c$$. But, this fixes c, I cannot do the same thing with the latter equation. It just seems like a intertwined puzzle I can't get hold of from any end.

I may also add the solution given to this problem:

I don't understand what they are trying to do here exactly.

• It's $a+c\leq 9$ and $c + e \leq 9$, I think. Apr 29 '19 at 12:43
• Why not choose $c$ first and then $b, d \ge c$ Apr 29 '19 at 12:44
• @MarkBennet You suggest drawing a tree? Apr 29 '19 at 12:45
• Keep in mind that $a\neq 0$ or you wouldn't technically have $5$ digits. Apr 29 '19 at 12:47
• Given a value of $c$, we can choose $b$ in $9-c$ ways ($a\gt 0$ so $c$ itself is not allowed) and $d$ in $10-c$ ways which replicates the solution given. Apr 29 '19 at 14:35

For each choice of $$c$$, there are $$10-c$$ choices for $$d$$ (any of $$c,\dots,9$$), and $$9-c$$ for $$a$$ ($$b$$ and $$e$$ are determined). So $$(10-c)(9-c)$$ choices. Hence the sum.
• But $a$ can't be zero , so wouldn't those $(9-c)$ cases contain cases in which $a=0$ ?? Apr 29 '19 at 13:19
• That case has been accounted for. That's why it's $(10-c)(9-c)$ instead of $(10-c)(10-c)$.
• Perhaps view it as $\sum_{c=0}^9 c(c+1)$: $c+1$ choices for $d$, and $c$ choices for $a$. Actually, I think I had written $(10-c)$ choices for $a$. It should be $(9-c)$. I have edited.
If $$c=0$$, then depending of $$b \neq 9$$(because $$a$$ cannot be $$0$$), $$a$$ could be from $$1$$ to $$9$$. And depending on $$d$$, $$e$$ could be from $$0$$ to $$9$$. So that is $$9*10$$ possibilities. For $$c=1$$, $$a$$ could go from $$1$$ to $$8$$ and $$e$$ could go from $$0$$ to $$8$$ for $$8*9$$ possibilities by similar argument. We do this for $$c=0$$ to $$c=9$$ to get the above formula.