The sum of any set of numbers is equal to the mean of the numbers multiplied by the number of numbers, so in this case, Mn/2, since we only take half of the n integers from 1 to n.
Since the space in between each even integer from 2 to n is consistent (2, in this case), this is an arithmetic sequence and the median is equal to the mean. The median in an arithmetic sequence will be equal to the mean of the two middle terms or the mean of the two outer terms. This is M = (2 + n)/2.
It follows that S = (n/2)(2 + n)/2.
The percentage difference is equal to the greater number minus the lesser number divided by the lesser number and then this figure multiplied by 100. In this case:
(((n/2)(1 + n)/2) - ((1 + n)/2))*100/(1 + n)/2
We can factor out (1 + n)/2) from top AND bottom so that:
(1 + n)/2)(n/2 - 1)*100/(1 + n)/2
(n/2 - 1)*100
((n - 2)/2)*100













