Calculate the Nth term

Problem Name:
Calculate the Nth term
Site:HackerRank
Links:
Tags:
Problem setters: