# What is my sequence's nth term?

Finds the nth term and the sum of the first n terms of an arithmetic or geometric sequence, lists the first terms, and writes its explicit and recursive formulas.

- Page: https://www.acalculator.org/math/sequence-calculator
- JSON spec: https://www.acalculator.org/math/sequence-calculator.json
- Version: 0c78503e348a

## Default answer

Example with the default inputs (Sequence Arithmetic, First term (a₁) 2, Common difference (d) 3, Term number (n) 10): Term 10 is 29, and the sum of terms 1 to 10 is 155.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| type | Sequence | Arithmetic adds the same difference each step; geometric multiplies by the same ratio. |
| a | First term (a₁) | The first term of the sequence. |
| d | Common difference (d) | What is added to each term to get the next one. |
| r | Common ratio (r) | What each term is multiplied by to get the next one. |
| n | Term number (n) | Which term to find, and how many terms to add up, from 1 to 10,000. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| nth | nth term (aₙ) | The value of term number n. |
| sum | Sum of the first n terms (Sₙ) | a₁ + a₂ + … + aₙ. |
| infinite | Sum to infinity | For a geometric sequence with −1 < r < 1, the limit of the sums: a₁ ÷ (1 − r). |
| terms | First terms | The first terms of the sequence, up to 10 of them. |
| explicit | Explicit formula | A formula for term number n on its own. |
| recursive | Recursive formula | The first term, and how each term follows from the one before. |

## Method

Arithmetic: aₙ = a₁ + (n − 1)d and Sₙ = n(a₁ + aₙ)/2. Geometric: aₙ = a₁ × r^(n − 1) and Sₙ = a₁(1 − rⁿ)/(1 − r) (n × a₁ when r = 1); for −1 < r < 1 the sum to infinity is a₁/(1 − r).

## Assumptions

- Terms are numbered from 1; the first term is a₁.
- The numbers are read as the exact decimals typed and the formulas are worked out in exact fractions; each result is then the nearest 64-bit float.
- A term or sum beyond about 1.8 × 10^308 has no answer.

## Worked examples

1. type = arithmetic, a = 2, d = 3, n = 10 gives nth = 29, sum = 155, terms = 2, 5, 8, 11, 14, 17, 20, 23, 26, 29, explicit = a_n = 2 + 3(n - 1), recursive = a_1 = 2, a_n = a_(n - 1) + 3. Source: Formulas from OpenStax College Algebra 2e, section 9.2: https://openstax.org/books/college-algebra-2e/pages/9-2-arithmetic-sequences.
2. type = geometric, a = 3, r = 2, n = 8 gives nth = 384, sum = 765, terms = 3, 6, 12, 24, 48, 96, 192, 384, explicit = a_n = 3 × 2^(n - 1).
3. type = geometric, a = 1, r = 0.5, n = 5 gives nth = 0.0625, sum = 1.9375, infinite = 2, terms = 1, 0.5, 0.25, 0.125, 0.0625.
4. type = arithmetic, a = 0.1, d = 0.2, n = 3 gives nth = 0.5, sum = 0.9, terms = 0.1, 0.3, 0.5.
5. type = geometric, a = 5, r = -3, n = 4 gives nth = -135, sum = -100, recursive = a_1 = 5, a_n = (-3) × a_(n - 1).
6. type = arithmetic, a = 10, d = -4, n = 6 gives nth = -10, sum = 0, explicit = a_n = 10 - 4(n - 1).

## FAQ

### What is an arithmetic sequence?

A list of numbers where the same amount, the common difference d, is added each time: 2, 5, 8, 11, … has d = 3. Its nth term is aₙ = a₁ + (n − 1)d.

### What is a geometric sequence?

A list of numbers where each term is the one before times the same number, the common ratio r: 3, 6, 12, 24, … has r = 2. Its nth term is aₙ = a₁ × r^(n − 1).

### How do I find the sum of an arithmetic sequence?

Multiply the number of terms by the average of the first and last terms: Sₙ = n(a₁ + aₙ)/2. For 2, 5, …, 29 (10 terms): 10 × (2 + 29)/2 = 155.

### How do I find the sum of a geometric sequence?

Use Sₙ = a₁(1 − rⁿ)/(1 − r) when r is not 1. For 3, 6, …, 384 (8 terms, r = 2): 3 × (1 − 256)/(1 − 2) = 765. When r = 1, every term is a₁, so Sₙ = n × a₁.

### When does a geometric series have a sum to infinity?

When the ratio is between −1 and 1. The terms then shrink toward 0, and the sums approach a₁/(1 − r). For 1, 0.5, 0.25, … that is 1/(1 − 0.5) = 2.

### What is the difference between an explicit and a recursive formula?

An explicit formula gives any term directly from n, such as aₙ = 2 + 3(n − 1). A recursive formula gives the first term and a rule for the next term from the one before, such as a₁ = 2, aₙ = aₙ₋₁ + 3.

### How do I tell if a sequence is arithmetic or geometric?

Subtract each term from the next: if the differences are all equal, it is arithmetic. Divide each term by the one before: if the ratios are all equal, it is geometric. 1, 4, 9, 16 is neither.

## Sources

- OpenStax, College Algebra 2e, section 9.2 Arithmetic Sequences: https://openstax.org/books/college-algebra-2e/pages/9-2-arithmetic-sequences
- OpenStax, College Algebra 2e, section 9.3 Geometric Sequences and 9.4 Series and Their Notations: https://openstax.org/books/college-algebra-2e/pages/9-4-series-and-their-notations
