Let the number subtracted to be x.
therefore,
\[\begin{array}{*{35}{l}}
\left( 7\text{ }-\text{ }x \right):\text{ }\left( 17\text{ }-\text{ }x \right)::\text{ }\left( 17\text{ }-\text{ }x \right):\text{ }\left( 47\text{ }-\text{ }x \right) \\
~ \\
\end{array}\]
\[\begin{array}{*{35}{l}}
\left( 7\text{ }-\text{ }x \right)\left( 17\text{ }-\text{ }x \right)\text{ }=\text{ }{{\left( 17\text{ }-\text{ }x \right)}^{2}} \\
329\text{ }-\text{ }47x\text{ }-\text{ }7x\text{ }+\text{ }{{x}^{2}}~=\text{ }289\text{ }-\text{ }34x\text{ }+\text{ }{{x}^{2}} \\
329\text{ }-\text{ }289\text{ }=\text{ }-34x\text{ }+\text{ }54x \\
20x\text{ }=\text{ }40 \\
x\text{ }=\text{ }2 \\
\end{array}\]
Therefore, the required number which must be subtracted is 2.