Evenly even

How many positive even integers up to 1000 (inclusive) have an even digit sum?

Details and assumptions

The digit sum of a number is the sum of all its digits. For example the digit sum of 1123 is 1 + 1 + 2 + 3 = 7 1 + 1 + 2 + 3 = 7 .


The answer is 249.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

9 solutions

Meet Udeshi
Dec 22, 2013

Let the number described be of the form a b c abc . It doesn't matter if a = 0 a=0 or if b = 0 b=0 when a = 0 a=0 because we also need to consider 2 digit and 1 digit numbers.

c c can be any one of { 0 , 2 , 4 , 6 , 8 } \{0,2,4,6,8\} .

Then be need to consider cases for b b :-

  • Case 1) b b is even a a is even because a + b + c a+b+c has to be even. Thus there are 5 values each for a a and b b This gives total of 5 × 5 × 5 = 125 5\times 5\times 5=125 numbers of this form

  • Case 2) b b is odd Now a a is odd because a + b + c a+b+c has to be even. Again there are 5 values each for a a and b b This gives total of 5 × 5 × 5 = 125 5\times 5\times 5=125 numbers.

We should note that we have also considered 0 0 in our list. So it is 249 249 numbers and not 250 250 .

Nice solution! :)

Happy Melodies - 7 years, 5 months ago

what about 100, 300, 500, 700, 900

Anirudha Nayak - 7 years, 5 months ago

Log in to reply

They all have odd digit sum! Say 100 100 , digit sum is 1 + 0 + 0 = 1 1+0+0 = 1 and 1 1 is odd, hence NOT satisfying the question

Happy Melodies - 7 years, 5 months ago

I considered 0 first...then i subtracted 1 from 250...249....good q...

Amlan Mishra - 7 years, 3 months ago

What about 1000, the question they asked 1000 inclusive.? So,answer will be 250...?

manoj kumar - 7 years, 5 months ago

Log in to reply

Notice that the digit sum of 1000 1000 is 1 + 0 + 0 + 0 = 1 1+0+0+0 = 1 , but 1 1 is odd. So, it is rejected.

敬全 钟 - 7 years, 5 months ago

Log in to reply

Sorry....go it...thanks...,

manoj kumar - 7 years, 5 months ago

Sorry forgot to mention that 1000 is rejected anyway.

Meet Udeshi - 7 years, 5 months ago
Parth Chopra
Dec 22, 2013

This problem can be broken down into three portions:

1 1 : The integer has 1 digit.

2 2 : The integer has 2 digits.

3 3 : The integer has 3 digits.

We can disregard the case of 4 digits, since 1000 does not have an even digit sum.

We first note that in order for an integer to be even, it needs to have an even ones' digit. We can now tackle each case separately. In the explanations, let it be noted that E E means even and O O means odd.

1 digit:

This set contains only 4 integers of the form E E which satisfy the given conditions, namely: ( 2 , 4 , 6 , 8 ) (2, 4, 6, 8) .

2 digits:

In order for a 2 digit even integer to have an even digit sum, it must have the form E , E E,E . This yields a total of ( 4 5 ) (4 * 5) or 20 possible integers.

3 digits:

In order for a 3 digit even integer to have an even digit sum, it must have the form E , E , E E,E,E or O , O , E O,O,E . For the first sub-case, there are a total of ( 4 5 5 ) (4 * 5 * 5) or 100 possible integers. For the second sub-case, there are a total of ( 5 5 5 ) (5 * 5 * 5) or 125 possible integers.

Combining all of these cases together, we yield that there are a total of ( 4 + 20 + 100 + 125 ) (4 + 20 + 100 + 125) or 249 \boxed{249} integers.

Xctly how I did it too :) ... (Y)

Kiran Dey - 7 years, 5 months ago

Nice Soln :)

R Prakash - 7 years, 4 months ago

How about O , O O, O in two digits?

敬全 钟 - 7 years, 5 months ago

Log in to reply

Yes it has an even digit sum but it is not an even integer.

Gabriel Aron Theodoroes - 7 years, 5 months ago

O,O may have an even digit sum but it is an odd number. Hence it contradicts the given criteria.

Mehul Arora - 6 years, 2 months ago
L de Mendonca
Dec 22, 2013

For an even number to have an even digit sum, the digits must be either odd-odd-even or even-even-even. This is because there must be an even number of digits that are odd. There are 5 even digits: 0 , 2 , 4 , 6 0, 2, 4, 6 and 8 8 . Therefore, there are 5 × 5 × 5 = 125 5\times5\times5=125 possibilities for a number that has all even digits. There are also 5 odd digits: 1 , 3 , 5 , 7 1, 3, 5, 7 and 9 9 . So there are, again, 5 × 5 × 5 = 125 5\times5\times5=125 numbers that have odd-odd-even as their digits. Therefore, the answer would be 250 250 . However, this would include 000 000 , which is not positive. Therefore, the answer is 250 1 = 249 250-1=249 .

Nice....The allowance of leading zeroes facilitates easier calculations...I calculated it separately

Eddie The Head - 7 years, 5 months ago
Bruno Oliveira
Mar 25, 2014

My Python one-liner:

len(filter(lambda x: x%2==0 , map(lambda x: sum(map(int,str(x))) ,filter(lambda z: z%2==0 ,[x for x in range(1,1001)]))))

Let us divide in 3 3 cases according to the digits:

  • If the number has got 1 1 digit, then there are 4 4 possibilities ( 2 , 4 , 6 , 8 , 2,4,6,8, ).
  • If the number has got 2 2 digits, then it has got to be of the form P P PP , where P P means a even digit. Hence there are 4 5 = 20 4\cdot5=20 possibilities, as the starting number cannot be a 0 0 .
  • If the number has got 3 3 digits, then it can be either P P P PPP or D D P DDP , where D D means an odd digit. Hence there are 4 5 5 + 5 3 = 225 4\cdot5\cdot5 + 5^3=225 possibilities.

Therefore the total is 4 + 20 + 225 = 249 4+20+225=\boxed{249} .

Christian Barrera
Dec 23, 2013

To simplify the solution, consider all three digit numbers as we exclude 1000 in the count because the digit sum is odd (1).

X X X

each digit X can be even or odd. We are to consider only the even numbers so the last digit should be even

X X E

For a sum to be even we should have an even number of odd digits regardless of the number of even digits. In this case, we should have either all even or 1 even and 2 odd digits.

Our possible combinations would then be the following: E E E, O O E

The number of even and odd digits we could use is 5 each (0 is applicable as leading 0 digits will still result to a positive integer less than 1000)

O O E = 5 x 5 x 5 = 125 E E E = 5 x 5 x 5 = 125

But we are only to consider positive integers, which means we should exclude the possibility of 0 0 0.

O O E = 125, E E E = 125 - 1 = 124

O O E + E E E = 125 + 124 = 249

Final Answer: 249

Roland Fong
Dec 22, 2013

Assume that a number less than 1000 has the form "XXX" where X is a placeholder for a digit. An even number will have the form "XXE" where E is a placeholder for an even digit. Additionally, Even + Even = Even and Odd + Odd = Even. This means there are two forms of even numbers less than 1000 whose digits sum to an even number (E = even digit, O = odd digit):

  • EEE
  • OOE

In the first case, EEE, all three digits are even, so the sum will be even. Since there are five even digits (0, 2, 4, 6, 8), we have 5 × 5 × 5 = 125 5 \times 5 \times 5 = 125 . However this allows for the case "000" which is not a number. Hence we must subtract 1, which gives us 124 valid numbers for the case EEE. Note that this accounts not only for 3 digit numbers but also for 2 digit and 1 digit numbers when the first two digits are 0 (example: 004 = 4, 028 = 22)

In the second case, OOE, the first two odd digits sum to an even number, and when added to the last digit, will result in an even digit sum. Since there are 5 odd digits (1, 3, 5, 7, 9) and 5 even digits, we have 5 × 5 × 5 = 125 5 \times 5 \times 5 = 125 . We do not have any cases that would not be valid positive integers. so we have the full 125 numbers for the case OOE.

If we add our totals, 124 + 125 = 249 124 + 125 = \boxed{249}

I forgot one thing - The problem states up to 1000 (inclusive). However since 1 + 0 + 0 + 0 is odd, we can discard 1000 as a possible solution.

Roland Fong - 7 years, 5 months ago
Marco Abensur
Dec 22, 2013

First you notice that for the sum of the digits of an even number to be also even you need to have this : if it is a number with 2 digits the 2 digits need to be even numbers, and if it is a 3 digit number you need to have or a odd,odd,even number (for example 334), or a even.even,even number (for example 464) (remember that the last digit is always even). So you have: 0,2,4,6,8 of one digit. then you have the two digit numbers 20,22,24,26,28 and the same with 40... 60.. 80.. Finally with 3 digits you have 110,112,114,116,118, 130. 132... 150.. 170...190... that's 25 numbers. Then you multiply this by 9 (because you do the same with 200,300...900). So in the end you have: 4 + 5x4 + 9x25 = 249

Sheldon Collier
Dec 22, 2013

In order for the digit sum to be even, all three digits must be even, or the first two must be odd and the third digit even. If EEE, then there are 5 x 5 x 5 such numbers. If OOE, then there are 5 x 5 x 5 such numbers. Subtract the case of 000 (the number zero) since the questions refers to positive even integers. Thus the answer is 125 + 125 - 1 = 249.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...