The formula is
A=p (1+r/k)^n
A 5000
P 2000
R interest rate 0.05
K compounded semiannually 2
N number of interest periods=kt= 2t
5000=2000 (1+0.05/2)^2t
Solve for t
5000/2000=(1+0.05/2)^2t
Log (5000/2000)=2t×log (1+0.05/2)
2t=Log (5000/2000)÷log (1+0.05/2)
T=(log(5,000÷2,000)÷log(1+0.05÷2))÷2
T=18.55 years round your answer to get 19 years
So the number of interest periods required to achieve the conditions set forth is
N=kt
N=2×19
N=38