It will take 49.8 years.
The equation for compound interest is

,
where A is the total amount in the account, p is the amount of principal invested, r is the interest rate as a decimal, and t is the amount of time. Substituting our information, we have:

Dividing both sides by 4000, we have:

We will use logarithms to undo the exponent:
