Norfolk Southern interview question

Write a code to find the nth term in a sequence