In this case we are making deposits each year in out account. This will be compounded at a 6% interest.
After 20 years of working and making deposits, the principal accumulated has to be able to give $30,000 per year for 30 years.
We can start with the principal. We assume that during retirement, the account yield 6% interest from the capital still in the account.
Then, we can calculate this principal as the present value of an annuity with payments PMT = $30,000, rate of interest r = 0.06 and n = 30 years.
The calculation is:

Now we know the amount of capital that has to be accumulated with the deposits.
This value is the future value of an annuity of n = 20 years at a rate r = 0.06.
But now, we need to calculate the yearly deposit D.
We can calculate it as:

Answer: the yearly deposit has to be $11,225.73.