A patient is administered 500 mg of a certain pharmaceutical every 6 hours. The half-life of the pharmaceutical in the body is 130 minutes. Determine the amount P(n) of the pharmaceutical that remains immediately after the patient takes the nth dose.
Using $$ P = P_{0}e^{-kn} \\ $$ With $$ P_0 = 500 \\ k = \frac{\ln 2 }{ T_{1/2}}\\ k = \frac{\ln 2}{114} $$
I get $$ P(n) = 500e^{-0.0053319013889*n} $$
But it is wrong...
An amount $A$ decays in $6$ hours to $cA$. Your solution shows that you know how to compute $c$.
Immediately after the first dose, the amount is $500$.
Immediately after the second dose, the amount is $500+500c$, since we have $500$ fresh stuff and $500c$ remaining from the first dose.
Immediately after the third dose, we have $500+(500+500c)c$, which is $500+500c+500c^2$. We have $500$ fresh stuff, and the amount immediately after the second dose has been multiplied by $c$.
For immediately after the fourth dose, we take $500$ and add $c$ times the previous answer.
Continue. Immediately after the $n$-th dose we have $$500+500c+500c^2+\cdots +500c^{n-1}.$$ Using the formula for the sum of a finite geometric progression, we can write the amount as $$\dfrac{500(1-c^n)}{1-c}.$$
Remark: Your calculation followed only what remained of the first dose, and did not take into account the $500$ mg administered every $6$ hours. Note that if the person continues to take the drug forever, the amount immediately after a dose approaches the value $\frac{500}{1-c}$.