HomeMath › 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

ParameterTypeUnitRequiredDescription
first_termnumberyesThe first term of the sequence.
common_differencenumberyesAmount added to each term to get the next (negative for a decreasing sequence).
nintegeryesIndex of the term to compute and the number of terms to sum. Range: ≥ 1, ≤ 1000000000

Outputs

OutputTypeUnitDescription
nth_termnumbera₁ + (n − 1) × d.
sumnumbern × (a₁ + aₙ) / 2.
first_termsnumber_listThe first min(n, 10) terms of the sequence.
explicit_formulastringThe 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

Sources

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