设缺失数为 x,y,已知其余数为 z1,…,z98。
利用总和与平方和:
x+y=5050−i=1∑98zi,
x2+y2=338350−i=1∑98zi2.
由
(x+y)2=x2+y2+2xy
可解出 xy,从而 x,y 是方程 t2−(x+y)t+xy=0 的两根,可唯一确定。
Original Explanation
Let the 98 distinct integers be z1,z2,…,z98. If the missing numbers are x and y, we know:
- x+y+i=1∑98zi=n=1∑100n=5050.
- x2+y2+i=1∑98zi2=n=1∑100n2=6100×101×201=338350.
So from the sum and the sum of squares, you can solve for x and y uniquely.