write the rule of an arithmetic sequence given a sequence