Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Sequences






Terms, Indices, and Patterns

A sequence is an ordered list of numbers where each element occupies a definite position. The position is the index, the element at that position is the term, and the rule connecting indices to terms — whether a formula, a recurrence, or an observed pattern — is the sequence's defining characteristic. Some sequences arise from repeated addition, others from repeated multiplication, and others from rules that resist any simple algebraic description. This page introduces the common language and notation, then maps out the principal families: progressions, figurate numbers, recursive sequences, and primes.



Definition and Notation

A sequence assigns a number to each positive integer. The input is the index nn, the output is the term ana_n. Writing a1,a2,a3,a_1, a_2, a_3, \ldots lists the terms in order; the subscript tells you where each term sits.

Formally, a sequence is a function f:NRf: \mathbb{N} \to \mathbb{R} — it takes a natural number and returns a real number. The function viewpoint makes precise what "ordered list" means: two sequences are equal exactly when an=bna_n = b_n for every index nn.

A sequence can be finite (a fixed number of terms, such as 3,7,11,153, 7, 11, 15) or infinite (continuing without end, such as 1,4,9,16,1, 4, 9, 16, \ldots). The ellipsis signals that the pattern continues, though what "the pattern" is must be stated explicitly — the sequence 1,2,4,1, 2, 4, \ldots could be powers of 22, or the start of something else entirely.

Two notations are standard. The brace form {an}n=1\{a_n\}_{n=1}^{\infty} names the entire sequence as a single object. The listing form a1,a2,a3,a_1, a_2, a_3, \ldots displays individual terms. Both are used interchangeably throughout this section.

Explicit and Recursive Definitions

There are two ways to specify a sequence. An explicit (closed-form) definition provides a formula that computes ana_n directly from nn. Given the index, you get the term in one step — no need to know any other terms. The sequence 1,4,9,16,25,1, 4, 9, 16, 25, \ldots has the explicit definition an=n2a_n = n^2.

A recursive definition computes each term from one or more previous terms, together with enough initial values to get started. The same sequence of perfect squares can be defined recursively as a1=1a_1 = 1, an=an1+2n1a_n = a_{n-1} + 2n - 1. To find the 5050th term, you would need to compute all 4949 terms before it.

The trade-off is direct access versus structural transparency. An explicit formula lets you jump to any term instantly. A recursive rule reveals how the sequence builds on itself — each term emerges from the ones before it — but forces you to compute terms in order.

Some sequences admit both forms. The arithmetic sequence 2,5,8,11,2, 5, 8, 11, \ldots can be written explicitly as an=3n1a_n = 3n - 1 or recursively as a1=2a_1 = 2, an=an1+3a_n = a_{n-1} + 3. Others, like the sequence of prime numbers, have no known closed-form expression and resist explicit formulation entirely.

Arithmetic Sequences

An arithmetic sequence is built by adding the same fixed value — the common difference dd — to each term to produce the next. Starting from an initial term a1a_1, the sequence unfolds as a1,a1+d,a1+2d,a1+3d,a_1, a_1 + d, a_1 + 2d, a_1 + 3d, \ldots, and the general term is:

an=a1+(n1)da_n = a_1 + (n - 1)d


The common difference governs direction and spacing. When d>0d > 0, the sequence increases; when d<0d < 0, it decreases; when d=0d = 0, every term is identical. The sequence 7,3,1,5,7, 3, -1, -5, \ldots has d=4d = -4, each term falling four units below the previous.

Arithmetic sequences produce the simplest summation formula in all of mathematics. The sum of the first nn terms — the arithmetic series — is:

Sn=n2(a1+an)S_n = \frac{n}{2}(a_1 + a_n)


The idea behind the formula is credited to Gauss: pair the first term with the last, the second with the second-to-last, and so on. Each pair sums to a1+ana_1 + a_n, and there are n2\frac{n}{2} such pairs.

Geometric Sequences

A geometric sequence is built by multiplying each term by a fixed value — the common ratio rr — to produce the next. Starting from a1a_1, the terms are a1,a1r,a1r2,a1r3,a_1, a_1 r, a_1 r^2, a_1 r^3, \ldots, and the general term is:

an=a1rn1a_n = a_1 \cdot r^{n-1}


Where arithmetic sequences grow (or shrink) by equal steps, geometric sequences grow (or shrink) by equal factors. The sequence 3,12,48,192,3, 12, 48, 192, \ldots has r=4r = 4; the sequence 100,50,25,12.5,100, -50, 25, -12.5, \ldots has r=12r = -\frac{1}{2}, alternating in sign with each term.

The sum of a finite geometric series has its own closed form:

Sn=a11rn1r(r1)S_n = a_1 \cdot \frac{1 - r^n}{1 - r} \quad (r \neq 1)


When r<1|r| < 1, the terms shrink toward zero fast enough that the infinite series converges to S=a11rS = \frac{a_1}{1 - r}. When r1|r| \geq 1, the terms do not diminish and the series diverges.

Harmonic Sequences

A harmonic sequence is formed by taking the reciprocals of an arithmetic sequence. If the arithmetic progression has first term b1b_1 and common difference dd, the harmonic sequence is:

an=1b1+(n1)da_n = \frac{1}{b_1 + (n-1)d}


The simplest example is 1,12,13,14,1, \frac{1}{2}, \frac{1}{3}, \frac{1}{4}, \ldots — the reciprocals of the natural numbers. The terms decrease toward zero, but they do so slowly. Unlike arithmetic and geometric sequences, harmonic sequences have no closed-form expression for their partial sums.

The harmonic series n=11n\sum_{n=1}^{\infty} \frac{1}{n} diverges, even though its terms approach zero. This stands in sharp contrast to the geometric series 12n\sum \frac{1}{2^n}, which converges. Approaching zero is necessary for convergence but not sufficient — the harmonic series is the most important illustration of this distinction.

The harmonic sequence connects to the other two progressions through the inequality of means: for any set of positive numbers, the harmonic mean is never greater than the geometric mean, which is never greater than the arithmetic mean (HGAH \leq G \leq A).

Fibonacci Numbers

The Fibonacci sequence is defined by a two-term recurrence: each term is the sum of its two immediate predecessors.

F1=1,F2=1,Fn=Fn1+Fn2(n3)F_1 = 1, \quad F_2 = 1, \quad F_n = F_{n-1} + F_{n-2} \quad (n \geq 3)


This produces the sequence 1,1,2,3,5,8,13,21,34,55,89,144,1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, \ldots, where growth accelerates because each new term inherits the size of both its parents.

The ratio of consecutive Fibonacci numbers Fn+1Fn\frac{F_{n+1}}{F_n} converges to the golden ratio ϕ=1+521.618\phi = \frac{1 + \sqrt{5}}{2} \approx 1.618, a number that satisfies ϕ2=ϕ+1\phi^2 = \phi + 1. Despite its recursive definition, the Fibonacci sequence has a closed-form expression known as Binet's formula:

Fn=ϕnψn5F_n = \frac{\phi^n - \psi^n}{\sqrt{5}}


where ψ=152\psi = \frac{1 - \sqrt{5}}{2}. The formula involves irrational numbers yet always yields an integer — a striking consequence of the algebraic relationship between ϕ\phi and ψ\psi.

Triangular Numbers

The triangular numbers count dots arranged in successively larger equilateral triangles: one dot in the first row, two in the second, three in the third, and so on. The nn-th triangular number is the sum of the first nn natural numbers:

Tn=1+2+3++n=n(n+1)2T_n = 1 + 2 + 3 + \cdots + n = \frac{n(n+1)}{2}


The first terms are 1,3,6,10,15,21,28,36,1, 3, 6, 10, 15, 21, 28, 36, \ldots. Recursively, Tn=Tn1+nT_n = T_{n-1} + n — each triangular number is built from the previous one by adding a new row.

The formula Tn=n(n+1)2T_n = \frac{n(n+1)}{2} also equals the binomial coefficient (n+12)\binom{n+1}{2}, the number of ways to choose 22 items from n+1n + 1. This connection places triangular numbers at the intersection of summation, geometry, and combinatorics.

A key identity ties triangular and square numbers together: the sum of two consecutive triangular numbers is always a perfect square, Tn+Tn1=n2T_n + T_{n-1} = n^2. Geometrically, two triangles of consecutive sizes fit together to form a square.

Square Numbers

The square numbers are the perfect squares 1,4,9,16,25,36,1, 4, 9, 16, 25, 36, \ldots, given by Sn=n2S_n = n^2. Each can be visualized as dots filling a square grid with nn rows and nn columns.

Recursively, the sequence satisfies Sn=Sn1+(2n1)S_n = S_{n-1} + (2n - 1). Each new square is built from the previous one by adding an L-shaped border of 2n12n - 1 dots. This means every perfect square is a sum of consecutive odd numbers:

n2=1+3+5++(2n1)n^2 = 1 + 3 + 5 + \cdots + (2n - 1)


The difference between consecutive squares is always odd: SnSn1=2n1S_n - S_{n-1} = 2n - 1. This connects square numbers to arithmetic sequences, since the odd numbers 1,3,5,7,1, 3, 5, 7, \ldots form an arithmetic progression with common difference 22.

The sum of the first nn squares has its own closed form:

k=1nk2=n(n+1)(2n+1)6\sum_{k=1}^{n} k^2 = \frac{n(n+1)(2n+1)}{6}


This formula appears throughout mathematics — in variance calculations, area approximations, and polynomial identities.

Prime Numbers

A prime number is an integer greater than 11 whose only positive divisors are 11 and itself. The first primes are 2,3,5,7,11,13,17,19,23,29,2, 3, 5, 7, 11, 13, 17, 19, 23, 29, \ldots. The number 11 is excluded by convention — it has only one divisor, not two.

Unlike every other sequence on this page, the primes follow no algebraic pattern. There is no formula that generates the nn-th prime from nn, no common difference, no common ratio, and no recurrence relation. Each prime must be discovered individually, typically by verifying that no integer from 22 to p\sqrt{p} divides it.

Euclid proved that the primes are infinite: no finite list can contain them all. The argument assumes finitely many primes p1,p2,,pkp_1, p_2, \ldots, p_k, forms the product N=p1p2pk+1N = p_1 p_2 \cdots p_k + 1, and observes that NN is not divisible by any prime on the list — so either NN itself is prime or it has a prime factor missing from the list.

Although primes never run out, they do thin out. The prime number theorem describes the rate: among integers near nn, roughly one in every lnn\ln n is prime. The primes become sparser as numbers grow, but they never vanish entirely.