Given this pseudo code of a function
f(0) = 1; f(1) = 3; f(n) = 3 * f(n - 1) - f(n - 2); // for n >= 2.
Is there a non recursive way of doing this?