The S&P 500, over its history, has returned north of 9% per year.
https://www.investopedia.com/ask/answers/042415/what-average...
https://www.investopedia.com/ask/answers/042415/what-average...
40000 * (1.09 ^ 70) = $16,669,203.
The first calculation uses 7%. It is the real return. You'll actually have $16m, but the purchasing power would be $4.5m in 2021 dollars.