def _annuity_pv_factor(r,n):
    """Present value factor for an annuity. Formula equivalent to C/r + r + C/(1+r)**2 + ... + C/(1+r)**n
    Parameters
    ----------.
    r: float
        Interest rate
    n: int
        Number of payments
    """
    return (1 - (1/(1+r)**n)) / r