function Example2(N)
%
% Solves the ivp y_{n+4}-2 y_{n+2}+ y_{n} =0
%  y_0=0, y_1=0, y_2 = 0, y_3= 1
% 
%
fprintf('\n')
disp('______________________________________________')
disp('i         yclosed           yrec       ')
disp('______________________________________________')
%
ye=zeros(1,N);
yr=zeros(1,N);
ye(1,1:N)=(1/4)*(-1+(0:N-1)+(1-(0:N-1)).*(-1).^(0:N-1));
%
yr(1,1)=0;yr(1,2)=0;yr(1,3)=0;yr(1,4)=1;
for i=5:N
    y0=yr(1,i-4);y1=yr(1,i-3);y2=yr(1,i-2);y3=yr(1,i-1);
    yr(1,i)=-y0+2*y2;
end
%
for i=1:N
fprintf(' %5.0f  %15.6e  %15.6e\n',i-1,ye(1,i),yr(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('Closed form','Recurrence',2)
