function [ s ] = payment1 ( p,n,r)
%This function computes the regular payment of a mortgage
%from its duration, initial amount and interest rate
s=p*r/((1-1/(1+r)^(n-1)));
end