Solution:
The maximum value is n2, which is attained for the partition into n arithmetic progressions {1,n+1,2n+1},…,{n,2n,3n}, each of difference n.
Suppose indeed that the set has been partitioned into N progressions, of respective lengths ℓi, and differences di, for 1⩽i⩽N. Since ℓi⩾3,
2i=1∑Ndi⩽i=1∑N(ℓi−1)di=i=1∑Nai−i=1∑Nbi
where ai and bi denote, respectively, the largest and smallest elements of progression i. Now
i=1∑Nbi⩾1+2+⋯+N=N(N+1)/2i=1∑Nai⩽(3n−N+1)+⋯+3n=N(6n−N+1)/2
and thus
2i=1∑Ndi⩽N(3n−N)⩽2n2
as N(3n−N) is increasing in N on the interval [0,3n/2] and since N⩽n. This completes the proof.