function Feb7()
n = 8;
A = randn(n,n);
b = randn(n,1);
k = 4;

% Method 1:
xLong = (A^k)\b;        % 2(k-1)n^3 + (2/3)n^3 flops

% Method 2:
[L,U,piv] = lu(A,'vector');    % (2/3)n^3
x = b;
for i=1:k
    x = U\(L\x(piv));    % 2n^2
end
[xLong x]

