Question d’entretien chez Norfolk Southern

Write a code to find the nth term in a sequence