Determine the sum of all possible values of a six digit (non leading zero) even number N that uses only the digits 0, 1, 2, 3, 4, 5.
- All the six digits may not appear in N, so that 543210 is NOT a valid entry.
- Some of these six digits can be repeated more than once in N.
The total of all the six digit numbers using digits 0-5 that have no leading zero and end in an even digit can be calculated by counting the total size of the set and multiplying by the average.
The total size of the set is 5*6*6*6*6*3=19440
The average can be calculated by averages per digit: 3, 2.5, 2.5, 2.5, 2.5, 2. Then the average is 3*10^5 + 2.5*10^4 + 2.5*10^3 + 2.5*10^2 + 2.5*10 + 2 = 327777.
Then the total is 19440*327777 = 6371984880.
These include numbers with and without repeat digits.
The numbers without repeat digits can be broken into three subgroups: ending in 0, 2, or 4.
For the subgroup ending in 0, there are 5!=120 of them and their average is 333330.
Then those total 120*333330=39999600.
For the subgroup ending in 2 there are 5!=120 of them (including leading zeros), and their average is 2.6*10^5 + 2.6*10^4 + 2.6*10^3 + 2.6*10^2 + 2.6*10 + 2 = 288888.
The leading zero numbers comprise 4!=24 of these and their average is 3.25*10^4 + 3.25*10^3 + 3.25*10^2 + 3.25*10 + 2 = 36109.5.
Then the subtotal without leading zeros is 120*288888 - 24*36109.5 = 33799932.
For the subgroup ending in 4 there are 5!=120 of them (including leading zeros), and their average is 2.2*10^5 + 2.2*10^4 + 2.2*10^3 + 2.2*10^2 + 2.2*10 + 4 = 244446.
The leading zero numbers comprise 4!=24 of these and their average is 2.75*10^4 + 2.75*10^3 + 2.75*10^2 + 2.75*10 + 4 = 30556.5.
Then the subtotal without leading zeros is 120*244446 - 24*30556.5 = 28600164.
The total KS wants then can be evaluated by subtracting these subgroup totals from the first total of all the numbers.
6371984880 - 39999600 - 33799932 - 28600164 = 6269585184.