Calculate the Nth term