function Ch2Example1(N,a)
%
% Solves the ivp y_{n+1}- 10 y_{n} = -(2/3) n - (4/3)
%  y_0=a
% 
%
fprintf('\n')
disp('______________________________________________________________________________________________')
disp('     i        y_n            yclosed                 abs error          rel error             ')
disp('______________________________________________________________________________________________')
ye=zeros(1,N);
yr=zeros(1,N);
ye(1,1:N)=(1/6)*(1:N)+(a-(1/6))*10.^(0:N-1);
%
yr(1,1)=a;
for i=2:N
    y0=yr(1,i-1);
    yr(1,i)=10*y0-(3/2)*(i-2)-(4/3);
end
%
for i=1:N
fprintf(' %5.0f  %15.6e  %15.6e  %15.6e %15.6e\n',i-1,yr(1,i),ye(1,i),abs(yr(1,i)-ye(1,i)),abs(yr(1,i)-ye(1,i))/abs(ye(1,i)))
end
xx=zeros(1,N);
xx(1,1:N)=(0:N-1);
plot(xx,ye,'r*',xx,yr,'b+')
xlabel('n','Fontsize',14);ylabel('y_n','Fontsize',14);
legend('Recurrence','Closed form',1)
