Home › Math › Arithmetic Sequence Calculator
Arithmetic Sequence Calculator
Computes the n-th term and the sum of the first n terms of an arithmetic progression from the first term and the common difference, and lists the first terms.
When to use
Terms increase or decrease by a constant amount (e.g. 2, 5, 8, …) and you need a specific term or the total of the first n terms.
Do not use when: Terms are multiplied by a constant ratio (use geometric-sequence) or you need interest that compounds (use compound-interest).
Formula
aₙ = a₁ + (n − 1)·d; Sₙ = n·(a₁ + aₙ)/2 = n·(2a₁ + (n − 1)·d)/2
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
first_term | number | yes | The first term of the sequence. | |
common_difference | number | yes | Amount added to each term to get the next (negative for a decreasing sequence). | |
n | integer | yes | Index of the term to compute and the number of terms to sum. Range: ≥ 1, ≤ 1000000000 |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
nth_term | number | a₁ + (n − 1) × d. | |
sum | number | n × (a₁ + aₙ) / 2. | |
first_terms | number_list | The first min(n, 10) terms of the sequence. | |
explicit_formula | string | The formula for the general term with the given values. |
Example
2, 5, 8, … (10 terms): {"first_term":2,"common_difference":3,"n":10} → {"nth_term":29,"sum":155,"first_terms":[2,5,8,11,14,17,20,23,26,29],"explicit_formula":"a_n = 2 + (n − 1) × 3"}
5, 3, 1, … (6 terms): {"first_term":5,"common_difference":-2,"n":6} → {"nth_term":-5,"sum":0,"first_terms":[5,3,1,-1,-3,-5]}
GET https://tttkmbb.com/api/v1/calculate/arithmetic-sequence?first_term=2&common_difference=3&n=10
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/arithmetic-sequence(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/arithmetic-sequence · Markdown: https://tttkmbb.com/math/arithmetic-sequence.md · JSON definition: https://tttkmbb.com/math/arithmetic-sequence.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="arithmetic-sequence" - OpenAPI operationId:
calculate_arithmetic_sequence - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – Arithmetic progression (reference)
- Wolfram MathWorld – Arithmetic Series (reference)
FAQ
How do I find d from two terms?
d = (a_m − a_k) / (m − k). For a₁ = 2 and a₄ = 11, d = (11 − 2) / 3 = 3.
Can the sum be zero or negative?
Yes. With a negative common difference the terms eventually become negative and the partial sums can decrease, as in 5, 3, 1, −1, −3, −5 whose sum is 0.
Related calculators
- Geometric Sequence Calculator — Sequences with a constant ratio instead of a constant difference.
- Simple Interest Calculator — Simple interest grows linearly like an arithmetic sequence.