Calculate compound interest using the standard formula
A = P(1 + r/n)^(nt)
Where:
A = Final amount
P = Principal amount
r = Annual interest rate
n = Number of times interest is compounded per year
t = Time in years
Calculate compound interest with weekly contributions, weekly compounding, and yearly capital gains tax
P = initial principal
R = weekly rate (as decimal)
weeks = number of weeks
weekly_contribution = amount contributed each week
capital_gains_tax = tax rate on profits (as decimal, e.g., 0.37 for 37%)
Returns (final_amount_after_tax, total_interest_before_tax, total_tax_paid)