def FV(i, n, pv=0, pmt=0, fv=0):
    """
    Calculates Future Value
    :param i:   Interest rate
    :param n:   Number of periods
    :param pv:  Present Value at t=0
    :param pmt: Payment
    :param fv:  Future Value in t=end
    :return:
    """
    return fv + pv * (1 + i) ** n + pmt * ((1 + i) ** n - 1 ) / i