Leviticus 25:52

And if there remain but few years unto the year of jubile, then he shall count with him, and according unto his years shall he give him again the price of his redemption.

Cross-reference

Leviticus 27:18 also scales redemption according to remaining Jubilee years, directly paralleling the logic here.