s = c(5.0, 5.3, 5.6, 5.8, 6.0, 6.1) s = s/100 n_spots = length(s) js = 2:n_spots numer = (1+s[js])^js denom = (1+s[1])^1 f_1t = ( numer/denom )^(1/(js-1)) - 1 print(round(f_1t * 100, 2))