What about:
return (Math.pow(2.0, days + 1) - 1) * initial_amount;
No iteration required. If you received the initial batch .5, then after 1 day you will have (2 ^ 2-1) * .5 == 1.5, after 2 days you will have (2 ^ 3-1) *. 5 == 3.5, etc.
Note that this assumes initial_amount on day 0, not 1. If you intend to start the first day, just remove + 1 from the expression.
Also note: if you are talking about money, the formula looks strange. Money usually doubles daily, including the initial amount. So, on the 1st day you will have 1 dollar, on the 2nd day 2 dollars, day 3 $ 4, etc.
source share