def pv_growing_annuity(n,c,r,g):
    """
     Objective: estimate present value of a growting annuity    
         c    : payment
         n    : number of payments
         r    : discount rate
         g    : growth rate  (g<r)
      formula : c/(r-g)*(1-((1+g)/(1+r))**n)
         e.g.
        >>>pv_growing_annuity(30,10000,0.1,0.05)
        150463.14700582038
    """
    tt=((1+g)/(1+r))**n
    return c/(r-g)*(1-tt)