horzLine = '________________________________________________________';
fprintf('\n\n               Homework #6, problem 3');
fprintf('\n\n 4y(n+2)-8y(n+1)+3y(n)=1, y(0)=2, y(1)=1 -> y(n)=(5+3^n)/2^(n+1)-1');
fprintf('\n\n  n |   Analytic y(n)   |   Numeric y(n)    | Difference \n%s\n', horzLine);

yOld = 1; yOlder = 2;
for n = 2:20 
    yNew = 2 * yOld - 0.75 * yOlder + 0.25;      % Numeric solution
    y = (5 + 3^n) / 2^(n+1) - 1;               % Analytic solution
    fprintf(' %2d | %17.10e | %17.10e | %.1e \n', n, y, yNew, abs(yNew-y) );
    yOlder = yOld; yOld = yNew;
end

fprintf('%s\n\n Round-off errors are zero - only powers of 2 in denominator\n\n', horzLine);
horzLine = '________________________________________________________';