function r=annuity(low, high, n)
i=linspace(low,high,10);
r=(1000./i).*((1+i).^n-1)./(1+i).^n;
