Sequence and Sum Calculator

Values can be whole numbers, decimals or fractions like 3/4. Everything is calculated exactly.

Disclaimer: This calculator gives estimates for general information only. It is not financial, medical or other professional advice. Sequence results are exact for the terms covered; an infinite sum is only reported when the series genuinely converges.

What this calculator does

A sequence is a list of numbers built by a rule, and most sequence questions are really one of five jobs. This page does all five, and it does the arithmetic exactly: values can be whole numbers, decimals or fractions, and results are carried as exact fractions rather than rounded decimals, so a sum like 1/3 + 1/3 + 1/3 comes out as exactly 1. The jobs are: arithmetic sequences, where each term adds the same difference; geometric sequences, where each term multiplies by the same ratio, with a proper check of whether the infinite sum exists; sequences defined by a formula in n that you type yourself; factorials and double factorials, computed as exact whole numbers with every digit shown; and subset sum, which searches a list of numbers for the combinations that add exactly to a target.

For the sequence modes the page shows the terms themselves, the nth term, and the sum of the first n terms (the partial sum), because seeing the terms is what tells you the rule was entered the way you meant it. For geometric sequences it also reports the infinite sum when, and only when, the series converges.

How to use it

  • Arithmetic: enter the first term, the common difference (what gets added each step, which can be negative or a fraction), and how many terms you want. You get the terms, the last term and the sum.
  • Geometric: enter the first term, the common ratio (what each term is multiplied by) and the number of terms. The infinite sum line tells you the limit when the ratio is strictly between -1 and 1, and says plainly when the series does not converge.
  • Formula in n: type the rule using n, with + – * / ^ and brackets. Shorthand like 2n and n(n + 1) is understood. Terms run from n = 1 upward, and the page shows each term and the running partial sums.
  • Factorial: choose n! or the double factorial n!!, enter n from 0 to 500, and get the exact value with its digit count.
  • Subset sum: list up to 22 positive numbers and a target. The page finds every combination of positions that adds exactly to the target and shows up to 20 of them, with the total count.

The formulas

Arithmetic sequences

The nth term is a + (n minus 1) times d, where a is the first term and d the common difference. The sum of the first n terms is n / 2 times (first term plus last term), which is the same as n / 2 times (2a + (n minus 1)d). That pairing trick, first with last, second with second-to-last, is why the formula works: every pair adds to the same total.

Geometric sequences

The nth term is a times r to the power (n minus 1). The sum of the first n terms is a times (r^n minus 1) / (r minus 1) when r is not 1, and simply n times a when r is 1. The infinite sum exists only when r lies strictly between -1 and 1, and then it is a / (1 minus r). At r = 1 the terms never shrink; at r = -1 they alternate without settling; beyond that they grow. In all those cases there is no infinite sum, and the page says so instead of printing a number the formula would formally produce.

Factorials

n! is the product 1 x 2 x … x n, with 0! defined as 1. The double factorial n!! multiplies every second number down from n: for odd n it is n x (n minus 2) x … x 3 x 1, and for even n it is n x (n minus 2) x … x 4 x 2, with 0!! and 1!! both equal to 1. Factorials grow faster than any exponential with a fixed base, which is why exact whole-number arithmetic matters here: 20! already has 19 digits, beyond what ordinary calculator arithmetic can hold exactly.

Subset sum

Subset sum asks which sub-collections of a list add to a target. There is no formula; the page searches. With k numbers there are 2 to the power k possible subsets, which is why the list is capped at 22 numbers (about 4.2 million subsets, still searchable in moments, while 30 numbers would be over a billion). The search works in exact fractions, so decimal targets like 4 from 1.5 + 2.5 are judged exactly, never by rounded arithmetic.

Worked examples

Arithmetic. First term 3, difference 5, ten terms: 3, 8, 13, 18, 23, 28, 33, 38, 43, 48. The tenth term is 3 + 9 x 5 = 48, and the sum is 10 / 2 x (3 + 48) = 255. With fractions it stays exact: first term 1.5, difference 0.5, six terms gives 1.5, 2, 2.5, 3, 3.5, 4 and a sum of 16.5.

Geometric, finite and infinite. First term 2, ratio 3, six terms: 2, 6, 18, 54, 162, 486, summing to 728. The infinite sum does not exist here because the terms grow. Change the ratio to 0.5 with a first term of 100 and the picture flips: the first five terms (100, 50, 25, 12.5, 6.25) sum to 193.75, and the infinite sum converges to 100 / (1 minus 0.5) = 200 exactly, which the partial sums approach but never pass.

Formula in n. The rule 2n + 1 generates the odd numbers from 3: terms 3, 5, 7, 9, 11 with partial sums 3, 8, 15, 24, 35. The rule n^2 generates the squares: 1, 4, 9, 16, 25, summing to 55. Entering a rule directly is the quickest way to test a pattern you have spotted in a list of numbers.

Factorial. 10! = 3,628,800, a 7-digit number. 20! = 2,432,902,008,176,640,000, all 19 digits exact. The double factorial 9!! = 9 x 7 x 5 x 3 x 1 = 945.

Subset sum. From 3, 5, 6, 8 with target 11 there are exactly two subsets: {3, 8} and {5, 6}. Nothing else in the list combines to 11, and the search proves that rather than sampling it.

Reading your result

For sequences, sanity-check the first two or three terms against your rule before trusting the sum; nearly every sequence error is a rule entered slightly differently from the one intended (a difference where a ratio belongs, or a formula that starts at n = 0 in the source you copied from, while this page starts at n = 1). For geometric results, treat the infinite sum as a limit: the partial sums approach it, and the gap after n terms is the infinite sum multiplied by r^n, which is why a ratio near 1 converges so slowly. For subset sum, a count of zero is a real answer: it means no combination of your numbers hits the target exactly, which is itself often the information you needed.

Limitations

  • Term caps. Arithmetic allows up to 10,000 terms (the first 100 are listed; the nth term and sum are computed for all of them). Geometric and formula modes allow 200 terms, because each term is generated and shown. Factorials stop at n = 500: 500! has 1,135 digits, already far beyond any practical use.
  • Subset sum is capped at 22 numbers for the counting reason explained above, and it accepts positive numbers only; zero or negative entries would make the search space and the pruning rules different in kind, so they are refused with a message rather than handled approximately. At most 20 matching subsets are listed, with the exact total count always reported.
  • Formula powers must be whole numbers. A formula like n^0.5 is refused: fractional powers of fractions are generally not exact, and this page does not print inexact results dressed as exact ones. Square roots of terms belong in a general calculator.
  • Convergence is judged on the ratio alone, which is complete for geometric series: |r| below 1 converges, anything else does not. No other infinite series is summed on this page; the formula mode is finite by design.

Frequently asked questions

What is the difference between a sequence and a series?

A sequence is the list of terms; a series is what you get by adding them. The sum of the first n terms of a sequence is called the nth partial sum of the series. On this page the terms are the sequence and the “sum of the first n terms” is the partial sum. An infinite sum is the limit of the partial sums as n grows, when that limit exists.

Why does the infinite sum only work for some ratios?

Because the partial sums only settle down when each new term is smaller than the last by a shrinking factor. With ratio 0.5 the terms halve each time and the sum closes in on 200 in the worked example. With ratio 1 every term adds the same amount forever, with ratio -1 the sum bounces between two values, and with a ratio beyond 1 the terms explode. The formula a / (1 minus r) would still produce a number in some of those cases, but it would not be the sum of anything, so the page refuses to call it one.

Why is 0! equal to 1?

By definition, and the definition is forced by consistency: n! counts the arrangements of n distinct items, there is exactly one way to arrange zero items, and the recurrence (n + 1)! = (n + 1) x n! only keeps working down to 0 if 0! is 1. It is the same empty-product rule that makes x^0 equal 1.

The subset search found nothing. Did I do something wrong?

Not necessarily. Exact targets are demanding: with whole numbers, any target that is not a combination of the list simply has no subset, and with decimals the target must match to the last fraction. Check three things: the target was entered in the same units as the list, no number was mistyped, and whether you expected a number to be usable twice. Each position can be used once only, so making 10 from a single 5 is impossible unless 5 appears twice in the list.

Can this page find the rule for a sequence I paste in?

No. This page works rules forwards: you give the rule, it gives the terms and sums. Working backwards from terms to a rule is a different job (differences and ratios of consecutive terms are the usual first test: constant differences mean arithmetic, constant ratios mean geometric). The formula mode helps once you have a candidate rule: enter it and compare its terms with yours.

Related calculators

Method: arithmetic and geometric terms and sums by the standard closed forms, evaluated in exact rational arithmetic; infinite geometric sums reported only for ratios strictly between -1 and 1; factorials by exact whole-number multiplication; subset sum by exhaustive search over at most 22 positive values in exact fractions. All fixtures verified against independently computed values. Last reviewed: 22 October 2026.