Goldman Sachs Interview Question

Simple recursive pattern related problem.