a = (remaining / remaining_count - min_period) / (remaining_count - 1) b = min_period - a c = 0 work [usually made a mistake and have to go back and fix it and propagate the fix through]: remainings[0] = 0 remainings[1] = min_period remainings[remaining_count] = remaining y(x) = ax^2 + bx + c y(0) = c = 0 y(1) = a + b + c = min_period y(remaining_count) = a (remaining_count^2) + b (remaining_count) + c = remaining c = 0 a + b = min_period a(remaining_count^2) + b(remaining_count) = remaining b = min_period - a a(remaining_count^2) + (min_period - a)(remaining_count) = remaining a * remaining_count^2 + min_period * remaining_count - a * remaining_count = remaining a * remaining_count^2 - a * remaining_count = remaining - min_period * remaining_count a * (remaining_count^2 - remaining_count) = remaining - min_period * remaining_count a = (remaining - min_period * remaining_count) / (remaining_count^2 - remaining_count) a = (remaining / remaining_count - min_period) / (remaining_count - 1)