function X = itseq(f, Xinit, n, r)
% Computes an iterative sequence of values.
X = zeros(n + 1, 1);
X(1) = Xinit;
for k = 1:n
     X(k + 1) = f(X(k), r);
end
