The formula for an arithmetic sequence, also known as an arithmetic progression (AP), is used to calculate the $$n$$th term and the sum of the first $$n$$ terms of the sequence. An arithmetic sequence is a sequence of numbers in which the difference between any two consecutive terms is constant. The formula for the $$n$$th term of an arithmetic sequence is:
$$ a_n = a_1 + (n - 1)d $$
where $$a_n$$ is the $$n$$th term, $$a_1$$ is the first term, $$n$$ is the position of the term in the sequence, and $$d$$ is the common difference between the terms.
The formula for the sum of the first $$n$$ terms of an arithmetic sequence is:
$$ S_n = \frac{n}{2}(2a_1 + (n - 1)d) $$
where $$S_n$$ is the sum of the first $$n$$ terms, $$a_1$$ is the first term, $$n$$ is the number of terms, and $$d$$ is the common difference.