I am solving the following problem:
Write a program to generate the first 60 terms in the sequence given by the difference equation: $$x_{k+1}=2.25x_{k}-0.5x_{k-1}$$ with starting values $x_1=\frac{1}{3}, x_2=\frac{1}{12}$. The exact solution is given by $x_k=\frac{4^{1-k}}{3}$. Make a semilog plot of the values you obtain as a function of k.
My attemp:
My program (in Octave) is the following:
function x=diff
n=60;
x(1)=1/3;
x(2)=1/12;
for i=3:n
x(i)=2.25*x(i-1)-0.5*x(i-2);
endfor
k=1:60;
semilogy(k,x)
endfunction
I performed the operations with the solution that they give me in the problem and I obtained the following graph:

But I don't know where the problem is, in my opinion my code is correct. I tried to see if the solution was not correct, but the general solution for the difference equation is the following: $x_k=c_1 4^{-k}+c_2 2^k$, and with the initial values it agrees with the one given in the exercise.
Beforehand thank you very much.
The general solution is $$ x_k=A·4^{-k}+B·2^k. $$ As the coefficient $A=\frac43$ of the exact solution is not representable in binary floating point, the numerical sequence will behave as if $B$ was some small value around $10^{-15}$. The first and second term become about equal at $k=17$, for the following sequence elements the second term will dominate, leading rapidly away from the exact solution.