Ta có : \(n=\overline{abcdef}=1000\overline{abc}+\overline{def}=6\left(\overline{abc}-\overline{def}\right)+994\overline{abc}+7\overline{def}\)\(=6.\left(\overline{abc}-\overline{def}\right)+7.142\overline{abc}+7\overline{def}\)
\(=6\left(\overline{abc}-\overline{def}\right)+7\left(142\overline{abc}+\overline{def}\right)\)
Vì \(\left(\overline{abc}-\overline{def}\right)⋮7\) nên \(6\left(\overline{abc}-\overline{def}\right)⋮7\)
Lại có \(7\left(142\overline{abc}+\overline{def}\right)⋮7\)
\(\Rightarrow n=6\left(\overline{abc}-\overline{def}\right)+7\left(142\overline{abc}+\overline{def}\right)⋮7\) (đpcm)