# The total number of seven digit numbers,the sum of whose digits is even are? [closed]

The total number of seven digit numbers,the sum of whose digits is even are?

-

## closed as off-topic by Jonas Meyer, hardmath, Aaron Maroja, TMM, quidMar 22 at 19:14

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Jonas Meyer, TMM, quid
If this question can be reworded to fit the rules in the help center, please edit the question.

I am confused with how to think about the summation of digit is even...here we are considering the whole digit as a even number ...but the quest is asking about No of seven digit number whose sum of digits are Even –  prem shekhar Apr 22 '11 at 13:41
@user9325 I tild that thing to kevin just to puzzle him...that he is right but the way he think about the question is not the right logic......i have given my explanations just below..although i aalso explained that where i am stucked........ –  prem shekhar Apr 22 '11 at 13:47
Seven digit no means seven digit integer number that has the digits whose sum is even lik....1234561=22(even).....i wanted to know how many number are lik that...i think i am clear now –  prem shekhar Apr 22 '11 at 13:49
Are you considering $000$ $000$ $2$ to be a seven digit number? –  JavaMan Apr 22 '11 at 19:27

Whatever the first (leftmost) six digits are, there are exactly $5$ ways to complete them to a $7$-digit number whose digit-sum is even, and $5$ ways to complete them to a $7$-digit number whose digit-sum is odd. So exactly half of the $7$-digit numbers have even digit-sum.

-

It's actually the same as the amount of 7 digit even numbers.

It's easy to see that the numbers satisfy the following recursion

$$a_n=9\cdot(a_{n-1}+a_{n-2}+\ldots+a_1) \text{ and } a_1=5$$

by just checking what happens for low values of $n$.

EDIT: Just to make things clear, when $n=1$ the amount of even 1-digit numbers and the amount of 1-digit numbers with sum even is the same because the numbers are the same, and that means there are $5$ such numbers.

Then, take the 2-digit numbers, let's start with those of the form $1\star$. Then, compared to the one digit numbers, those who will have even sum are those with second digit an odd one, but there are still $5$. Then for the numbers of the form $2\star$, the ones with an even last digit will be OK, again $5$ numbers. And so on, in total, we'll get $9\cdot 5$ even sum 2-digit numbers.

For 3-digit numbers, we can apply the same reasoning, look at $1\star\star$, then the ones with even sum of digits will be the ones that had odd sums of 1- and 2-digit numbers. There are $5+45$. Apply a similar reasoning to $2\star\star,\ldots,9\star\star$ and you get $9 \cdot (5 + 45) = 450$ such numbers.

So, you'll see that my recursion formula is indeed correct.

-
please read the comments below the questions...i think you will get to know what exactly i am tring to find..thax for your explanation –  prem shekhar Apr 22 '11 at 13:51
That doesn't change my answer. I can add some clarification if you want, but the answer is still correct. –  Raskolnikov Apr 22 '11 at 13:54

Interesting recursion the one in the answer by @Raskolnikov. Let's try our hand at giving a closed from solution. For simplicity, define $b_n = a_{n + 1}$, and define the ordinary generating function: $$B(z) = \sum_{n \ge 0} b_n z^n$$ The original recursion is now: $$b_{n + 1} = 9 \sum_{0 \le k \le n} b_k \qquad b_0 = 5$$ Using properties of ordinary generating functions (see e.g. Wilf's "generatingfunctionology") this gives: $$\frac{B(z) - 5}{z} = 9 \frac{1}{1 - z} B(z)$$ Your tame computer algebra package (or pencil and paper) gives: $$B(z) = \frac{1}{2} + \frac{9}{2} \cdot \frac{1}{1 - 10 z}$$ From here one can read the coefficients: $$b_n = \begin{cases} 5 & n = 0 \\ \frac{9}{2} \cdot 10^n & n \ge 1 \end{cases}$$ But we are interested in $a_n = b_{n - 1}$, which for $n \ge 2$ is $\frac{9}{5} \cdot 10^n$. For the original question, we have $a_6 = 450,000$.

[Sorry for the rambling, but this just doesn't fit into a comment].

-