x=1:20;
y=zeros(1,20);
for k=1:20
    y(k)=g(k,2);
end
plot(x,y);