Rudder Analytics Interview Question

pentagonal number series in programming round.