Total number of terms, N=1000, is even.
For an even-sized ordered list, the median is the average of the 2N-th and (2N+1)-th terms.
The 500-th term is 500k and the 501-st term is 501k.
M equals 2500k+501k=21001k=500.5k.
M.D.=10001∑i=11000∣ik−500.5k∣
=1000k∑i=11000∣i−500.5∣.
S=∑i=11000∣i−500.5∣.
Because the list is symmetric around 500.5, the absolute differences come in equal pairs.
For i=1,2,…,500 we have distances
499.5,498.5,…,0.5,
an arithmetic progression with
first term a1=499.5, last term a500=0.5, number of terms n=500.
Sum of these 500 terms:
S500=2n(a1+a500)=2500(499.5+0.5)=250×500=125000.
The same sum occurs for i=501,502,…,1000 (distances 0.5,1.5,…,499.5).
S=2×125000=250000.
Mean deviation about the median equals 500, so
1000k×250000=500.
k2=22=4.