Home › Math › Geometric Sequence Calculator
Geometric Sequence Calculator
Computes the n-th term and the sum of the first n terms of a geometric progression from the first term and common ratio, plus the sum to infinity when |r| < 1.
When to use
Each term is the previous one multiplied by a constant ratio (e.g. 3, 6, 12, …) and you need a term, a partial sum or the limit of the series.
Do not use when: Terms change by a constant difference (use arithmetic-sequence) or you need a money value with periodic deposits (use future-value / compound-interest).
Formula
aₙ = a₁·r^(n−1); Sₙ = a₁·(1 − rⁿ)/(1 − r) for r ≠ 1 (Sₙ = n·a₁ for r = 1); S∞ = a₁/(1 − r) for |r| < 1
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
first_term | number | yes | The first term of the sequence. | |
common_ratio | number | yes | Factor between consecutive terms (may be negative or fractional). | |
n | integer | yes | Index of the term to compute and the number of terms to sum. Range: ≥ 1, ≤ 100000 |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
nth_term | number | a₁ × r^(n − 1). | |
sum | number | a₁ × (1 − rⁿ) / (1 − r), or n × a₁ when r = 1. | |
infinite_sum | number | a₁ / (1 − r); only when |r| < 1 (the series converges). | |
converges | boolean | true when |r| < 1, so the infinite sum exists. | |
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
3, 6, 12, … (5 terms): {"first_term":3,"common_ratio":2,"n":5} → {"nth_term":48,"sum":93,"converges":false,"first_terms":[3,6,12,24,48],"explicit_formula":"a_n = 3 × 2^(n − 1)"}
1, 1/2, 1/4, … (4 terms): {"first_term":1,"common_ratio":0.5,"n":4} → {"nth_term":0.125,"sum":1.875,"infinite_sum":2,"converges":true}
GET https://tttkmbb.com/api/v1/calculate/geometric-sequence?first_term=3&common_ratio=2&n=5
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/geometric-sequence(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/geometric-sequence · Markdown: https://tttkmbb.com/math/geometric-sequence.md · JSON definition: https://tttkmbb.com/math/geometric-sequence.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="geometric-sequence" - OpenAPI operationId:
calculate_geometric_sequence - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – Geometric progression (reference)
- Wikipedia – Geometric series (reference)
- Wolfram MathWorld – Geometric Series (reference)
FAQ
When does the infinite sum exist?
Only when |r| < 1; then the terms shrink toward zero and the partial sums approach a₁ / (1 − r). For |r| ≥ 1 the series diverges and infinite_sum is omitted.
What if the ratio is negative?
Terms alternate in sign. The formulas still apply, and the series converges when |r| < 1 (e.g. r = −0.5 gives S∞ = a₁ / 1.5).
Related calculators
- Arithmetic Sequence Calculator — Sequences with a constant difference.
- Compound Interest Calculator — Compound growth is a geometric sequence in the balance.
- Exponent Calculator — The power rⁿ used in the formulas.