1+2+3+...+n=(n-1)*16+x=n(n+1)/2
x=n(n+1)/2 -16(n-1)
=1/2*(n^2+n-32n+32)
=1/2*(n^2-31n+32)≤n
n^2-33n+32≤0
1≤n≤32
n=31,x=16