Hi Mirian,
This is s a problem where you can use the future value of an annuity to find the answer
the formula is
FV = P*(((1+i)n -1)/i)
where
FV = future value
P = montly payment
i = interest per period
N = number of periods
FV = 1000000
P = need to find this
i = .08/12 = .0066667
n = 40 * 12 = 480
1000000=P *(((1.006667)480 -1)/.006667)
1000000 = p * 3491
286.45 = P (this is the monthly amount to contribute
Hope this helps