The rule of the simple interest is

I is the amount of interest
P is the initial amount
R is the interest rate in decimal
T is the time
We need to find the initial amount if the new amount is $20,000, the interest rate is 5% for 4 years, then
A = 20000
R = 5/100 = 0.05
T = 4
Substitute them in the rules above

You need to deposit $16,666.67
The rule of the compounded interest

A is the new amount
P is the initial amount
r is the interest rate in decimal
t is the time
A = 20000
r = 0.05
t = 4
Substitute them in the rule above

You need to deposit $16,454.05