Goldman Sachs interview question

Simple recursive pattern related problem.