Pergunta de entrevista da empresa Norfolk Southern

Write a code to find the nth term in a sequence