Find a general formula for the nth term of an arithmetic sequence.