Kissflow interview question

Write a code for the given number series in the loops and the recursion?