Counting danger

There are n n four-digit numbers of which each has at least one even and one odd digit. If S S denotes the sum of all such four-digit numbers, find S + n S+n .


The answer is 43309500.

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.

1 solution

First, we find the count n a n_a and the sum S a S_a of all four-digit positive integers: n a = 9 × 1 0 3 = 9000 n_a = 9\times 10^3 = 9000 ; of these 9000 numbers, the average value of the first digit is 5 5 , and that of the next three digits it is 4 1 2 4\tfrac12 , so that the average value of these numbers is 5 ( 4 1 2 ) ( 4 1 2 ) ( 4 1 2 ) = 5499 1 2 , 5(4\tfrac12)(4\tfrac12)(4\tfrac12) = 5499\tfrac12, so that the sum is S a = 9000 × 5499 1 2 = 49 495 500. S_a = 9000 \times 5499\tfrac12 = 49\,495\,500.

We will subtract out all number that have only odd digits. They are of the form a b c d abcd where a , b , c , d { 1 , 3 , 5 , 7 , 9 } a,b,c,d \in \{1,3,5,7,9\} . n o = 5 4 = 625 ; n_o = 5^4 = 625; their average value is 5555 5555 , so S o = 625 × 5555 = 3 471 875. S_o = 625 \times 5555 = 3\,471\,875.

Likewise, the numbers with only even digits. They are of the form a b c d abcd with a { 2 , 4 , 6 , 8 } a \in \{2,4,6,8\} and b , c , d { 0 , 2 , 4 , 6 , 8 } b,c,d \in \{0,2,4,6,8\} . Thus n e = 4 5 3 = 500 , n_e = 4\cdot 5^3 = 500, and since their average value is 5444 5444 , we have S e = 500 × 5444 = 2 722 000. S_e = 500 \times 5444 = 2\,722\,000.

The answers are therefore n = n a n o n e = 9000 625 500 = 7875 , n = n_a - n_o - n_e = 9000 - 625 - 500 = 7875, S = S a S o S e = 49 495 500 3 471 875 2 722 000 = 43 301 625 , S = S_a - S_o - S_e = 49\,495\,500 - 3\,471\,875 - 2\,722\,000 = 43\,301\,625, S + n = 43 309 500 . S + n = \boxed{43\,309\,500}.

In the third line, you write 5 ( 4 1 2 ) ( 4 1 2 ) ( 4 1 2 ) = 5499 1 2 , 5(4\tfrac12)(4\tfrac12)(4\tfrac12)=5499\tfrac12, in what I assume is a sort of concatenation, but I think it would be clearer to write 5 × 1 0 3 + ( 4 1 2 ) × 1 0 2 + ( 4 1 2 ) × 1 0 1 + ( 4 1 2 ) × 1 0 0 = 5499 1 2 . 5\times 10^3+(4\tfrac12)\times 10^2+(4\tfrac12)\times 10^1+(4\tfrac12)\times 10^0=5499\tfrac12.

Miles Koumouris - 3 years, 6 months ago

Log in to reply

That's indeed what it represents. A bit funny for notation, perhaps, but pretty effective, I thought.

Arjen Vreugdenhil - 3 years, 6 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...