Leviticus 25:51-52

CLV(i) 51 Should there still be many years, corresponding to them he shall refund for his redemption out of the silver of his buying price. 52 And if few years remain until the year of jubilee then he will compute the amount due to him corresponding to his remaining years, and he shall refund it for his redemption.