title: Convert recursive function to iterative
body: <p>I have this recursive defined function:</p>
  
  <p><a href="https://i.stack.imgur.com/gudxw.png" rel="nofollow noreferrer">Function</a></p>
  
  <p>And I've already implemented it in C++:</p>
  
  <pre><code>int f_recursive(int n) {
  if (n &lt;= 2) {
      return 1;
  }
  else {
      return ( n * f_recursive(n - 1) - f_recursive(n - 2) );
  }
  </code></pre>
  
  <p>How can I calculate the same function iteratively?</p>