From the question, it seems to imply that since
"the first payment due as a lump sum in 18 years"
The payment is due on day 1 (the beginning) of the 18th year. Which is why you calculate the PV of the ordinary annuity at year 17. Which is why $173,255.28 is the present value of 4 payments of $50,000 each.
The PV at the end of year 17 can also be calculated as:
(50,000/(1+0.06)^1) + (50,000/(1+0.06)^2) + (50,000/(1+0.06)^3) + (50,000/(1+0.06)^4) = $173,255.28
Perhaps that's a bit more intuitive? (Discounting the cash flows by the time period they occur after the end of year 17, for the subsequent 4 years)
Then since $173,255.28 is the PV at year 17, the deposit needed today to ensure that
the grandparents have $173,255.28 at the end of year 17 is (173,255.28/(1+0.06)^17) as stated in the solution.