title: What is a non recursive solution for Fibonacci-like sequence in Java?
body: <p>Given this pseudo code of a function</p>
  
  <pre><code>f(0) = 1; 
  f(1) = 3; 
  f(n) = 3 * f(n - 1) - f(n - 2); // for n &gt;= 2.
  </code></pre>
  
  <p>Is there a non recursive way of doing this?</p>