Add iterative version of f(n)