There are standard formulas for this but let's calculate it using first principals.... Since the interest is compounded monthly, the rate will be .06/12 = .005
Let x be the amount of money that you deposit at the beginning of the month and make a table
Month Start of Month End of Month
1 x 1.005x
2 1.005x + x 1.0052x + 1.005x
3 1.0052x + 1.005x + x 1.0053x + 1.0052x + 1.005x
360 1.005359x + 1.005358x +...+ 1.005x + x 1.005360x + 1.005359x +....+ 1.005x
So at the end of 30 years or 360 months
let Sum = 1.005360x + 1.005359x +.......+ 1.0052x + 1.005x
the 1.005Sum = 1.005361x + 1.005360x +.....+ 1.0053 + 1.0052x
Then 1.005Sum - Sum = 1.005361x - 1.005x then Sum = {x(1.005361 - 1.005)}/(.005) = 1009.54x
Then x = 1,000,000/1009.54 = $990.55 invested each month.