
EXAMPLE

The solution sets of smallest values of xd(x) deviations with 1, 2, 3, 4, 5, 6 terms are as follows: {6}, {3, 4}, {9, 10, 12}, {25, 26, 28, 30}, {841, 842, 844, 848, 850}, {17642, 17648, 17650, 17654, 17658, 17670}. Thus difference xd(x) for x={25, 26, 28, 30} with d(x)={3, 4, 6, 8} divisors is equally 22, so a(4)=22.


MATHEMATICA

s = Array[#  DivisorSigma[0, #] &, {20000}]; t = Length@ Position[s, #] & /@ Range@ Max@ s; Table[FirstPosition[t, n], {n, 0, 6}] // Flatten (* Michael De Vlieger, Oct 09 2015 *)
