Given that 1006 positive integers all of which are different from each other sum up to 1019057 and also that none of them exceed 2012, find the minimum number of these integers which must be odd?
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.
exactly the same way as I did
How I solved it as well.
solved in exactly similar way
There are 1006 even numbers from 2 to 2012. The sum of the numbers is 1006*1007.
The remaining odd numbers must add up to 1019057-1013042=6015. 6015/3=2005 so the three numbers must have an average of 2005.
We can exchange some of the even numbers with odd numbers to attain our condition. 2005+2, 2005+4, 2005+6 or 2007, 2009, and 2011.
First, lets try to see what happens when we try to form this without any odd numbers.
sum(range(2,2013,2))
The sum of all the even numbers between 1 and 2012 inclusive is 1 0 1 3 0 4 2 which is 6 0 1 5 less than 1019057.
Note that we now have filled all the 1006 slots with even numbers. To increase the sum, we must remove some of the even numbers and replace them with odd numbers.
Factorise 6015.
factor(6015)
6 0 1 5 = 2 0 0 5 × 3 Wow! Inserting 2005 three times will do the trick. We cannot however take 2005 three times. (Since all the 1006 ints are distinct.) Instead we should notice that 2 0 0 5 = 2 0 1 1 − 6 = 2 0 0 9 − 4 = 2 0 0 7 − 2
Hence, the only set that satisfies this condition is
As you see, we need three odd numbers.
Please vote up if you liked this
Although it does not affect the answer as the question wants the minimum of odds, you have overlooked that 6015 in fact factors into 3 \times 5 \times 401
6015 \equals 5 \times 1203
6015 \equals 15 \times 401
This means that more such sets exists, with 5, 15, 401, and 1203 odds respectively. (Each of them has many subsets which I won't write out.)
Problem Loading...
Note Loading...
Set Loading...
If you try all even, you will find that (2+2012)*1006/2=(1000+6)(1000+7)
=1000000+13000+42=1013042.
This is 6015 short. When you move 2,4,6 to 2007,2009,2011 you make it.
3