An approximate number, that can be calculated mentally, is by using the rule of 72: Divide 72 by the interest in % to give the number of years needed to double the money.
In this case, the approximate number of years
n= 72/4=18 years (approximately)
Precise value by compound interest formula:
2P=P*(1.04)^n
=>
1.04^n=2
take logs on both sides
nlog(1.04)=log(2)
n=log(2)/log(1.04)=17.673 years