Arithmetic and Geometric Sequence Calculator

Arithmetic and Geometric Sequence Calculator

Find the nth term and the sum of an arithmetic sequence (constant difference) or a geometric sequence (constant ratio), including the sum to infinity, a sum between two terms, or the terms behind a target or two known values.

Every figuretap a card to copy its value

Terms and running sum

First terms with running sums

Arithmetic: aₙ = a₁ + (n − 1)d and Sₙ = n(a₁ + aₙ) ÷ 2. Geometric: aₙ = a₁ rⁿ⁻¹ and Sₙ = a₁(1 − rⁿ) ÷ (1 − r), or n × a₁ when r = 1; the sum to infinity a₁ ÷ (1 − r) needs r between −1 and 1. Answers are exact whole number arithmetic up to about 40,000 digits, then floating point to about 10 significant digits. Lists are compared exactly, with differences or ratios within 1 part in a billion counted as equal. Exports contain only the values you entered.

How to use this tool

Pick what to work out from the first menu. The first two choices take a first term, a common difference (arithmetic) or common ratio (geometric) and a number of terms, and give the nth term, the sum, the term list and, for a converging geometric series, the sum to infinity. The other four rebuild a sequence from two known terms, find the first term that reaches a target, classify a list of three to six numbers as arithmetic, geometric, both or neither, or add a block from term i to term j.

The input people most often get wrong is n. It counts terms, not steps, and the first term is number 1, so ten terms means nine steps of the difference. The second is the ratio: growth of 5% a step is r = 1.05, not 0.05, and a 5% loss is 0.95. Type whole numbers, decimals or fractions such as 1/3, and up to 100,000 terms. Sums are exact until the answer would pass about 40,000 digits. Then the tool switches to floating point, shows about 10 significant digits and says so.

What the calculation is doing

An arithmetic sequence adds the same difference d each step, so aₙ = a₁ + (n − 1)d, and the sum of n terms is Sₙ = n(a₁ + aₙ) ÷ 2, the number of terms times the average of the first and last. A geometric sequence multiplies by the same ratio r, so aₙ = a₁rⁿ⁻¹ and Sₙ = a₁(1 − rⁿ) ÷ (1 − r). At r = 1 that divides by zero, so the tool uses Sₙ = n × a₁ there. When r lies strictly between −1 and 1 the terms shrink to zero and the sum to infinity is a₁ ÷ (1 − r). For any other ratio the series diverges, and the tool says so instead of printing a number.

The other modes turn these formulas round. Two terms x at position p and y at position q are q − p steps apart, so d = (y − x) ÷ (q − p), and for geometric r to the power q − p equals y ÷ x. A target position comes from n = (target − a₁) ÷ d + 1, or n = ln(target ÷ a₁) ÷ ln(r) + 1, rounded up to the next whole term. When classifying a list, two differences or ratios count as equal if they match exactly or agree to 1 part in a billion, which forgives a rounded last digit and nothing looser.

Two panels. On the left, ten columns for the numbers 1 to 10, each made of a teal bar of height k and an orange bar of height 11 minus k, so every column is 11 tall, giving 2 times the sum equals 10 times 11, which is 110, and the sum is 55; a box shows the default sequence 2, 5, 8 up to 29 with first plus last equal to 31, five pairs and a sum of 155. On the right, a bar split into halves, quarters, eighths and sixteenths for the series 0.5 plus 0.25 plus 0.125, with a table of partial sums 0.5, 0.75, 0.875, 0.9375, 0.96875 after five terms, 0.9990234375 after ten and 0.9999990463 after twenty, and gaps to the limit of 1 that halve each time, plus a note that a ratio of 1.5 has no limit because ten terms already reach 113.330078125
The teal and orange bars are the same staircase, one upside down, which is why the pairs always match. The table shows the geometric version of the same idea. In this series the sum never passes 1, and the missing piece is exactly the size of the next term.

Why the ratio decides everything

An arithmetic sequence is a straight line. A geometric sequence changes by the same percentage each step, so it bends. Above a ratio of 1 it eventually outruns any straight line. Between 0 and 1 it decays, and the terms shrink faster than you add them up. For 0.5 + 0.25 + 0.125 and on, the sum after n terms is 1 − 0.5ⁿ, so the gap to 1 halves each step: 0.0009765625 after ten terms, and within 1% after seven. The limit a₁ ÷ (1 − r) is what the partial sums approach and never pass. That is how 0.3 + 0.03 + 0.003 and on becomes exactly 1/3.

The boundaries are where mistakes hide. At r = 1 the sum grows along a straight line, n × a₁. At r = −1 the partial sums flip between a₁ and 0 and never settle. Below −1 the terms alternate in sign and grow. A ratio between −1 and 0 converges, alternating around the limit: 1 − 1/2 + 1/4 and on heads for 2/3. From two terms an even number of positions apart, a ratio and its negative give the same power, so two real sequences can fit: 6 at position 2 and 54 at position 4 fit r = 3 from 2 and r = −3 from −2. If the later value has the opposite sign, none fits. The tool lists every valid answer.

The pairing behind the arithmetic sum is usually told as a story about the young Gauss adding 1 to 100: fifty pairs of 101 make 5,050. MacTutor at the University of St Andrews tells it as fact, but Brian Hayes, who traced the retellings for American Scientist, found the numbers 1 to 100 missing from the earliest telling and could not say whether it happened that way. The pairing works for any run of terms whatever the story.

Arithmetic and geometric growth side by side

Both sequences start at 1. The arithmetic one adds 10 each step and the geometric one doubles.

Term numberArithmetic term1 plus 10 each stepArithmetic sumGeometric term1 times 2 each stepGeometric sum
11111
2111223
3213347
5411051631
76121764127
10914605121,023
151411,06516,38432,767
201911,920524,2881,048,575
302914,380536,870,9121,073,741,823
5049112,300562,949,953,421,3121,125,899,906,842,623

Doubling starts behind: at term 6 it is 32 against 51. The geometric term passes at term 7 (64 against 61) and the geometric sum at term 9 (511 against 369). By term 50 doubling is at 562,949,953,421,312 against 491. An early lead for a fixed amount says nothing about the long run.

A worked example you can check on paper

The default view is 2, 5, 8 and on with 10 terms. The tenth term is a₁₀ = 2 + (10 − 1) × 3 = 29, and S₁₀ = 10 × (2 + 29) ÷ 2 = 10 × 31 ÷ 2 = 155. The other form gives 10 × (2 × 2 + 9 × 3) ÷ 2 = 155, and adding the ten terms by hand agrees.

Geometric, first term 2, ratio 3, four terms: S₄ = 2 × (1 − 3⁴) ÷ (1 − 3) = 2 × (−80) ÷ (−2) = 80, which matches 2 + 6 + 18 + 54. With first term 144 and ratio 4/9 the sum to infinity is 144 ÷ (5/9) = 1296/5 = 259.2.

Two known terms, a₃ = 11 and a₈ = 26, are 5 steps apart, so d = 15 ÷ 5 = 3 and a₁ = 11 − 2 × 3 = 5. For 3, 7, 11 and on to reach 100, n = (100 − 3) ÷ 4 + 1 = 25.25, which rounds up to 26: a₂₅ = 99 and a₂₆ = 103, so 100 falls between them.

Mistakes that catch people out

Counting steps instead of terms. The nth term adds n − 1 differences. If your source numbers the first term 0, add 1 to every position before entering it.

Entering a percentage as the ratio. Growth of 5% a step is r = 1.05. Typing 0.05 makes a sequence that loses 95% at every step.

Using the infinite sum when the ratio is too big. The formula a₁ ÷ (1 − r) returns −a₁ for r = 2, but the series does not converge and that number means nothing. The tool says it diverges.

Assuming a short pattern is the pattern. 1, 2, 4 looks geometric, but it is equally the start of 1, 2, 4, 7, 11, where the differences grow by 1. Three terms cannot tell them apart, and the verdict covers only the numbers you typed.

Expecting rounded data to fit exactly. The values 1.41, 2, 2.83 are close to a geometric sequence with ratio √2 but are not one. Within about 1% of a pattern, the tool says it is close and that rounding may be hiding the rule.

Popular calculations

Each opens the calculator with those figures filled in, and they can be changed once it is open.

Arithmetic sequences

Geometric sequences and sums to infinity

Recover a sequence from two terms

Which term reaches a target

Arithmetic, geometric or neither

Sum from one term to another

How this was checked

The engine works in exact fractions, so it was checked against a separate fraction class written for the test. Random arithmetic sequences, geometric sequences over 21 ratios including 0, 1 and −1, block sums, two term recoveries and target positions were compared with adding terms one at a time and stepping to find positions. Classification was tested on 500 random lists built to be arithmetic, geometric or neither. In all, 38,648 comparisons passed and none failed. For long sequences the exact and floating point routes were compared at 3,000 terms, and the largest relative difference was 2.9 × 10^−13. No case up to 100,000 terms produced Infinity or NaN.

Published examples were reproduced exactly. OpenStax Precalculus 2e, sections 11.2 to 11.4: 5 + 8 + 11 and on to 32 is 185, 20 + 15 + 10 and on to −50 is −225, and a₁ = 3 with a₄ = 24 gives r = 2. OpenStax Algebra and Trigonometry, sections 13.2 to 13.4: 2 + 6 + 18 + 54 is 80 and 1 + 1/2 + 1/4 and on is 2. The Lamar University Calculus II notes give 144 with ratio 4/9 as 1296/5. The tool returned each one. Every address in the lists above was also opened and checked for a distinct title, the right answer and a chart that renders. The layout was checked from 320 to 1280 pixels wide, and the CSV, image and print output hold only the values entered.

Common questions

What is the difference between an arithmetic and a geometric sequence?

An arithmetic sequence adds the same amount to get from one term to the next, so 3, 7, 11, 15 adds 4 each time. A geometric sequence multiplies by the same amount, so 3, 6, 12, 24 doubles each time. Differences are constant in the first and ratios in the second: a fixed increase is arithmetic, a fixed percentage is geometric.

How do you find the nth term?

For an arithmetic sequence use aₙ = a₁ + (n − 1)d. For a geometric sequence use aₙ = a₁rⁿ⁻¹. For 5, 8, 11 and on, the 20th term is 5 + 19 × 3 = 62. For 5, 10, 20 and on, it is 5 × 2¹⁹ = 2,621,440.

When does a geometric series have a sum?

When the common ratio is strictly between −1 and 1. Then the terms shrink towards zero and the sum to infinity is a₁ ÷ (1 − r). For 0.5 + 0.25 + 0.125 + ... that is 0.5 ÷ 0.5 = 1. If the ratio is 1 or larger, or −1 or smaller, the series diverges and has no finite sum.

How do you add up an arithmetic sequence without adding every term?

Multiply the number of terms by the average of the first and last term: Sₙ = n(a₁ + aₙ) ÷ 2. For the whole numbers 1 to 100 that is 100 × 101 ÷ 2 = 5,050. It works because the terms pair up: first with last, second with second last, and so on, each pair adding to the same amount.

How do you find which term of a sequence is a given number?

For an arithmetic sequence solve n = (target − a₁) ÷ d + 1. In 3, 7, 11 and on, 99 gives n = (99 − 3) ÷ 4 + 1 = 25, so 99 is the 25th term. For 100, n is 25.25, so the 26th term (103) is the first at or past it. For a geometric sequence use n = ln(target ÷ a₁) ÷ ln(r) + 1 and round up the same way.

Can a sequence be both arithmetic and geometric?

Only a constant one. If the terms a, a + d, a + 2d are also geometric, then (a + d)² = a(a + 2d), which simplifies to d² = 0. So the difference must be zero, and a list such as 5, 5, 5, 5 has difference 0 and ratio 1. The identify mode reports this as both.

Related Calculators and Reference