Leviticus 25:15-16

25:15 You may buy it from your fellow citizen according to the number of years since the last jubilee; he may sell it to you according to the years of produce that are left. 25:16 The more years there are, the more you may make its purchase price, and the fewer years there are, the less you must make its purchase price, because he is only selling to you a number of years of produce.

Leviticus 25:27

25:27 he is to calculate the value of the years it was sold, refund the balance to the man to whom he had sold it, and return to his property.

Leviticus 25:51-52

25:51 If there are still many years, in keeping with them he must refund most of the cost of his purchase for his redemption, 25:52 but if only a few years remain until the jubilee, he must calculate for himself in keeping with the remaining years and refund it for his redemption.