We are given the following data:
- Original machine cost = 70,000 Rupees.
- Resale values and maintenance costs for each year.
The total cost for each year is calculated by the formula:
\[
{Total Cost} = {Original Machine Cost} + \sum {Maintenance Costs for each year} - {Resale Value at the end of year } n
\]
For each year, we calculate the total cost and then determine the average total cost per year.
Year 1:
\[
TC_1 = 70000 + 19100 - 40000 = 49100
\]
\[
{Average Cost}_1 = \frac{49100}{1} = 49100
\]
Year 2:
\[
TC_2 = 70000 + 19100 + 20300 - 30000 = 89400
\]
\[
{Average Cost}_2 = \frac{89400}{2} = 44700
\]
Year 3:
\[
TC_3 = 70000 + 19100 + 20300 + 23500 - 25000 = 107900
\]
\[
{Average Cost}_3 = \frac{107900}{3} = 35966.67
\]
Year 4:
\[
TC_4 = 70000 + 19100 + 20300 + 23500 + 30500 - 22000 = 141400
\]
\[
{Average Cost}_4 = \frac{141400}{4} = 35350
\]
Year 5:
\[
TC_5 = 70000 + 19100 + 20300 + 23500 + 30500 + 40000 - 20000 = 213400
\]
\[
{Average Cost}_5 = \frac{213400}{5} = 42680
\]
The average cost is minimized after 4 years. Therefore, the machine should be replaced after \( \boxed{4} \) years.