Since
∑xi=1, we have
2∑i<jxixj=1−∑xi2. Doubling the given equation and rearranging,
1−i=1∑216xi2=215214+i=1∑2161−aiaixi2, so
2151=i=1∑216(1+1−aiai)xi2=i=1∑2161−aixi2.
Now
∑ai=(21+⋯+22151) +22151=1, so
∑(1−ai)=216−1=215. By the Cauchy-Schwarz inequality,
1=(i=1∑216xi)2≤(i=1∑2161−aixi2)⋅(i=1∑216(1−ai))=2151⋅215=1.
Equality holds, so
xi is proportional to
1−ai, forcing
xi=2151−ai. The only, hence maximum, possible value of
x2 is
2151−41=8603, and
m+n=3+860=863.