HELP !!! can somebody explain me please how can i understanding this exercise correct ? thank you in advance

The set of numbers 1,2,....,2002 is divided into 2 groups, one comprising numbers with odd sums of digits and the other comprising numbers with even sum of digits. Let A be the sum of the numbers in the first group and B be the sum of the numbers in the second group. Find A - B. (Ukranian Maths Olympiad, 9th grade, 2002)

@TheSmartOne please one example suppose between 1 till 10

ty

I'm not sure what the trick is for this problem. But I can give you some smaller groups of numbers that I tried, if it will get you on the right track.

When our set of numbers is 1,2,3,...,10 a = {1,3,5,7,9,10} b = {2,4,6,8} They say let A be the sum of the numbers in the first group, A = 1 + 3 + 5 + ... + 10 = 35 and B be the sum of the numbers in the other group, B = 2 + 4 + 6 + 8 = 20 So then A - B = 35 - 20 = 15

When our set of numbers is 1,2,3,...,20 a = {1,3,5,7,9,10,12,14,16,18} b ={2,4,6,8,11,13,15,17,19,20} A = 1 + 3 + 5 + ... + 18 = 95 B = 2 + 4 + 6 + ... + 20 = 115 So then A - B = 95 - 115 = -20

When our set of numbers is 1,2,3,...,30 a={1,3,5,7,9,10,12,14,16,18,21,23,25,27,29,30} b={2,4,6,8,11,13,15,17,19,20,22,24,26,28} A = 1 + 3 + 5 + ... + 30 = 250 B = 2 + 4 + 6 + ... + 28 = 215 So then A - B = 35

@Zepdrix thank you very much - is clearly now - ok. ty.

consider the numbers who have their digits summing to even as True and the ones with digits summing to odd as False for the number range [0,9] (10 numbers) B - A = 5 now if we add a 1 in front of all these numbers we get the range [10,19] so all the true numbers from the Range [0-9] become false and all the False numbers from [0-9] become true B-A for the range [10-19] is -5 because the values got flipped similarly B-A for the range [20-29] is +5

run \(\href{https://repl.it/repls/StaidEachCoordinates}{this}\) code to see the pattern

|dw:1563655473545:dw|