Use excel, formula in first cell:
In second cell:
Repeat these formulas and in end of 24 year you will have 91,402.19. You withdraw 40,000 and you will have in the start of 25 year 51,402.19. So, 24 year is the last.
Your uncle can make the 40,000 withdrawals during 24 years and he has 35,000 left in the end.