Sum of series calculator
Add the first n terms of an arithmetic or geometric series with one closed formula: 3 + 5 + 7 + 9 + 11 is 35, and 2 + 6 + 18 + 54 is 80. You also get the last term. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Kind
- Arithmetic
- First
- 3
- Step
- 2
- N
- 5
- Last
- 11
- Sum
- 35
The sum of a series is the total of its first n terms, not a list of those terms. Two families cover most of what students, analysts, and engineers actually type into a calculator: an arithmetic series, where each term grows by a constant step, and a geometric series, where each term is multiplied by a constant ratio. This capability takes the family, the first term, that step or ratio, and a positive integer count, then evaluates the closed formula for the partial sum. It does not expand every term into an array, it does not sum an infinite geometric tail, and it does not invent a result when the count is zero, negative, or fractional.
Arithmetic and geometric partial-sum formulas
An arithmetic series adds a constant step between consecutive terms. If the first term is a and the step is d, the terms run a, a plus d, a plus two d, and so on, and the last of n terms is a plus n minus one times d.
Pairing the first term with the last, the second with the second-to-last, and so on produces n over two pairs that each total two a plus n minus one times d, which is why the closed sum equals n over two times two a plus n minus one times d. A classroom check is three plus five plus seven plus nine plus eleven: first term three, step two, five terms, sum thirty-five.
A geometric series instead multiplies by a constant ratio r, so the terms are a, a r, a r squared, up to a times r to the n minus one. When r is not one the finite sum is a times one minus r to the n, all over one minus r; when r is exactly one every term equals a and the sum collapses to n times a.
Two plus six plus eighteen plus fifty-four is the four-term case with first term two and ratio three, and the sum is eighty.
Limits, related searches, and practical checks
When teaching, prefer paired examples that lock both families: three, five, seven, nine, eleven for arithmetic, and two, six, eighteen, fifty-four for geometric, plus a zero count that demonstrates the hard rejection path. This page targets people searching for a sum of series calculator who already have the first term, the step or ratio, and n, and who need one contract that covers both families.
An infinite geometric tail with absolute ratio strictly less than one is a different query and a different formula; a last-term shortcut that only needs a1, an, and n is a different query again. Prefer the closed form over inventing a mode that expands every term: one request covers classroom sums and large-n checks without shipping huge arrays, and the echoed last term lets you confirm the n-th member by hand before you trust the total.
What you can do with it
Programming contest and interview validators
Assert candidate solutions for classic series-sum problems without reimplementing both closed forms in every language harness.
Finance and growth schedules
Sum a level increment (arithmetic) or a constant growth factor (geometric) over a known number of periods in pipelines where a closed form is safer than looping every row.
FAQ
How do I find the sum of the first n terms of an arithmetic series?
Set kind to arithmetic, first to a₁, step to the common difference d, and n to the term count. The sum is n/2 × (2×first + (n−1)×step). Example: first 3, step 2, n 5 → 35.
How do I find the sum of the first n terms of a geometric series?
Example: first 2, ratio 3, n 4 → 80.
Why is the term count rejected when it is not a positive integer?
A partial sum of the first n terms needs n ≥ 1 as a whole count.
Is this the infinite geometric series sum S = a / (1 − r)?
No. This calculator sums a finite number of terms. The infinite sum is a different search and only converges when |r| < 1.
What does the sum of series calculator cost?
The browser tool is free and runs locally.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/math/sum-of-series \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"kind":"arithmetic","first":3,"step":2,"n":5}'const res = await fetch("https://api.kit.forhosting.com/math/sum-of-series", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"kind": "arithmetic",
"first": 3,
"step": 2,
"n": 5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/sum-of-series",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"kind": "arithmetic",
"first": 3,
"step": 2,
"n": 5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/sum-of-series", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"kind":"arithmetic","first":3,"step":2,"n":5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"kind":"arithmetic","first":3,"step":2,"n":5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/sum-of-series", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"kind": "arithmetic",
"first": 3,
"step": 2,
"n": 5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.sum_of_series",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_n | 1000000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
The same pure function runs in the free browser tool and on the API path, so a homework check and a batch job never disagree on a textbook total.
Arithmetic and geometric partial-sum formulas
Because both identities are closed forms, this endpoint never walks the terms in a loop, never depends on the wall clock, and never draws a random sample.
How to call the calculator and what comes back
Use it from homework pipelines, contest validators, spreadsheet enrichment jobs, or any workflow that needs a reproducible partial sum without installing a computer-algebra system on every machine. Send a JSON body with four required fields. Field kind is the series family and must be the enum value arithmetic or geometric; aliases type, series, and mode are accepted. Field first is a finite number, the first term, with aliases a, a1, and first_term. Field step is a finite number whose meaning follows kind: the common difference when the family is arithmetic, or the common ratio when the family is geometric. Aliases d, difference, and common_difference suit the arithmetic reading; aliases ratio, r, and common_ratio suit the geometric reading. Field n is the term count and must be a whole integer from one through one million; aliases terms and count are accepted. On success the response echoes kind, first, step, and n as coerced values, plus last (the n-th term), sum (the partial total you asked for), and formula (the identity that was applied). Failed validation — a missing field, a non-number for first or step, a kind outside the enum, or a count that is not a positive integer — returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item.
Limits, related searches, and practical checks
Keep n inside the published range so interactive Worker and browser paths stay exact for ordinary teaching and business sizes. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners type a fractional or zero count while learning the contract.
Integration use cases
Homework: first n terms of either family
Give students the family, first term, step or ratio, and count; check their hand-computed partial sum against a deterministic API or free browser result.