ForHosting KIT · Math

Arithmetic sequence calculator

Start at 2 and add 3 each time: the fifth term is 14, and the first five terms add up to 40. Enter the first term, the common difference and a position to get that term and the running total together. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
A
2
D
3
N
5
You get
Term
14
Sum
40

An arithmetic sequence (also called an arithmetic progression) is a list of numbers where each term after the first is formed by adding a fixed common difference. Negative first terms, negative differences, zero difference (a constant sequence), and fractional steps are all supported as long as values stay finite. Indices below one are rejected with a clear validation error so homework tools and scripts cannot silently treat a zeroth term as valid under this convention.

How the n-th term and partial sum are defined

An arithmetic progression is completely determined by its first term a and its common difference d. The sequence reads a, a plus d, a plus two d, a plus three d, and so on. For a quick check, take a equals two, d equals three, and n equals five: the terms are two, five, eight, eleven, fourteen; the fifth term is fourteen and the sum is forty.

Another check with a decreasing sequence: a equals ten, d equals negative two, n equals four yields terms ten, eight, six, four; the fourth term is four and the sum is twenty-eight. Constant sequences are allowed when d is zero: every term equals a and S_n equals n times a.

Where arithmetic sequences show up in real work

Data and analytics demos sometimes use evenly spaced ladders as synthetic load levels, price steps, or schedule offsets; computing the n-th value and the cumulative sum in one call keeps those ladders honest. Finance-style storytelling about linear growth or fixed decrements is easier to illustrate when term and sum are returned together rather than forcing a second pass. If you later need geometric progressions, recursive sequence solvers, or interpolation of a missing middle term from three known values, treat those as separate search intents rather than overloading this arithmetic-sequence landing.

Evenly spaced ladders in demos

Generate linear sequences for load-test levels, pricing steps, or schedule offsets and obtain both the selected step and the cumulative total.

What formulas does this arithmetic sequence calculator use?

The n-th term is a + (n − 1)·d. The partial sum of the first n terms is S_n = n/2 · (2a + (n − 1)·d). Indexing is 1-based.

What happens if n is below 1?

The term index n must be at least 1 under this convention.

Are fractional first terms and differences allowed?

Yes. a and d may be any finite numbers (including decimals). n must still be an integer between 1 and 1,000,000.

What does it cost?

The browser tool is free and runs locally.

Can the sequence go down instead of up?

Yes, use a negative common difference. Starting at 10 and subtracting 2 gives 10, 8, 6 and 4, so the fourth term is 4 and the sum of those four terms is 28.

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.

POSThttps://api.kit.forhosting.com/math/arithmetic-sequence

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.

curl -X POST https://api.kit.forhosting.com/math/arithmetic-sequence \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"a":2,"d":3,"n":5}'
{
  "a": 2,
  "d": 3,
  "n": 5
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.arithmetic_sequence",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

min_n1
max_n1000000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Given the first term a, the common difference d, and a positive integer index n, this calculator returns the exact n-th term and the sum of the first n terms using the closed-form formulas taught in algebra: a_n equals a plus (n minus one) times d, and S_n equals n over two times the quantity two a plus (n minus one) times d. The free browser tool and the paid API share one pure function, so classroom demos and automated pipelines never silently diverge.

How the n-th term and partial sum are defined

Using one-based indexing, the n-th term is therefore a_n equals a plus (n minus one) times d. That single multiplication replaces iterating n steps and is the formula students meet in textbooks when they are asked for a specific term without writing the whole list. The partial sum of the first n terms, written S_n, is the sum a plus a_2 plus ellipsis plus a_n. There is a closed form that avoids adding term by term: S_n equals n over two multiplied by the quantity two a plus (n minus one) times d, which is algebraically the same as n times the average of the first and last terms.

What you send and what you get back

The error for n below one states that the term index must be at least one so form clients and scripts can correct the input without guessing. Example: a equals two, d equals three, n equals five returns term fourteen and sum forty. Example: a equals five, d equals zero, n equals three returns term five and sum fifteen. Example: a equals one point five, d equals zero point five, n equals four returns term three and sum nine. Provide three fields: a (aliases first, a1, first_term) for the first term, d (aliases difference, common_difference) for the common difference, and n (aliases number, index, term) for the one-based term index. a and d may be any finite numbers, including negatives and decimals; n must be an integer from one through one million inclusive. Missing fields, non-numeric values, NaN, Infinity, non-integer n, and any n below one are rejected with invalid_input and are not charged. On success the response echoes the normalized a, d, and n, and adds term (the n-th term) and sum (the partial sum of the first n terms). API pricing is the published base of $0.002 per successful item; failed validation does not consume balance.

Where arithmetic sequences show up in real work

Product teams building education apps need a deterministic endpoint that matches the classroom convention (first term is term one, n less than one is invalid) so their UI never disagrees with the API on edge cases. Because this capability is a pure parse engine, it runs fully in the browser for free interactive use and on the Worker path for automation at $0.002 per successful item.

Homework and contest answer keys

Compute the n-th term and the sum of the first n terms for algebra problems, olympiad fixtures, and automated grading with a single deterministic call.

Teaching closed-form formulas

Show students that a_n and S_n match the textbook identities for positive, negative, and zero common differences without iterative addition mistakes.

Can the common difference be negative or zero?

Yes. Negative d produces a decreasing sequence; d = 0 is a constant sequence where every term equals a and S_n = n·a.

Read the full KIT documentation →