function geometric_sum(z)

N      = 100;
geo    = zeros(1,N);
geo(1) = z;

for k = 2:N
    geo(k) = geo(k-1)*z + z;
end

plot([0 geo],'*-');
hold on;
sum = z/(1-z);
plot(sum,'r*');
axis([-2 2 -2 2]);
grid on;
hold off;