clear all

e=1;

%x^2 - e x -1=0

d=roots([1,-e,-1]);
x1=max(d);

x(1)=1;t(1)=1;

for ia=2:150
    t(ia)=ia;
    x(ia)=sqrt(1+e*x(ia-1));
end


figure(1)
plot(t,x,'or',t,x1*exp(0*t),'b','linewidth',2)
xlabel('n')
ylabel('x(n)')
set(gca,'Fontsize',24)
figure(2)
semilogy(t,abs(x-x1*exp(0*t)),'.r','linewidth',2,'markersize',16)
xlabel('n')
ylabel('x(n)-xe')
set(gca,'Fontsize',24)









