if you invested money into an account that pays 9% a compounded weekly, how many years would it take for your deposit to double?

Using the formula: A=P(1+i)^n

hummm

I do not think you mean
".....pays 9% a compounded weekly"
but
".....pays 9% a YEAR compounded weekly"
and I will assume that
so every month increase is 9%/12
which is .0075
so every month multiply by 1.0075
2 = 1.0075^n where n is number of months
log 2 = n log 1.0075
n = 92.8 months
= 7.73 years

To find out how many years it would take for your deposit to double when invested in an account that pays 9% compounded weekly, we can use the formula for compound interest:

A = P(1 + r/n)^(nt)

Where:
A is the future value (amount after interest)
P is the principal (initial deposit)
r is the annual interest rate (as a decimal)
n is the number of times interest is compounded per year
t is the number of years

In this case, we want to find the value of t when the future value (A) is double the principal (P). So, we can rewrite the formula as:

2P = P(1 + 0.09/52)^(52t)

Simplifying, we get:

2 = (1 + 0.09/52)^(52t)

Now, we need to solve for t. To do this, we can take the natural logarithm (ln) of both sides of the equation to eliminate the exponent:

ln(2) = ln((1 + 0.09/52)^(52t))

Using the property of logarithms, we can bring down the exponent:

ln(2) = 52t * ln(1 + 0.09/52)

Next, divide both sides of the equation by 52 * ln(1 + 0.09/52) to isolate t:

t = ln(2) / (52 * ln(1 + 0.09/52))

Using a calculator or a programming language, we can find the approximate value of t. After performing the calculations, we find that it would take approximately 8.04 years for your deposit to double in this account.