joan took out a mortgage from hel local bank . each monthly mortgage payment she makes must be triple the amount of the previous month ' s payment . if her first payment is $ 100 , and the total amount she must pay back is $ 914800 , how many months will it take joan to pay back her mortgage ?
import math
n0 = 100.0
n1 = 914800.0
t0 = math.log(max(1e-5, 3.0), 2)
t1 = n1 * 2.0
t2 = t1 / n0
t3 = t2 + 1.0
t4 = math.log(max(1e-5, t3), 2)
answer = t4 / t0
print(answer)