Ta có :
\(\left|x-1\right|+\left|x-2017\right|\ge x-1+2017-x=2016\)
\(\left|x-2\right|+\left|x-2016\right|\ge x-2+2016-x=2014\)
....
\(\left|x-1008\right|+\left|x-1010\right|\ge x-1008+1010-x=2\)
\(\left|x-1009\right|\ge0\)
\(\Rightarrow P\ge2016+2014+....+2+0\)
\(\Rightarrow P\ge1017072\)
Dấu " = " xảy ra khi \(\begin{cases}\begin{cases}x-1>0\\2017-x>0\end{cases}\\.....\\x-1009=0\end{cases}\)
=> x = 1009
Vậy ......