freeCodeCamp/guide/english/mathematics/arithmetic-sequence/index.md

894 B

title
Arithmetic Sequence

Arithmetic Sequence

An arithmetic sequence, or arithmetic progression, is a sequence of numbers where the difference between each consecutive number is the same.

If n is the placement of some term in the sequence (e.g. 1, 2, 3...), d is the difference between each consecutive term, k is the first the placement of the first known term of the sequence (e.g. if you know the first term, then k = 1), ak is the value of the kth term in the sequence (i.e. the value at term number k), and an is the value of the nth term in the sequence (i.e. the value at term number n), then the equation for an arithmetic sequence is this1:

an = ak + d(n - k)

Sources

  1. "Arithmetic Progressions." Brilliant.org. October 1, 2018.