Find nth term of arithmetic sequence