# 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.

- Calculator id: `geometric-sequence` · Category: Math (`math`) · Tool name: `calculate_geometric_sequence`
- Canonical page: https://tttkmbb.com/math/geometric-sequence · This document: https://tttkmbb.com/math/geometric-sequence.md · JSON definition: https://tttkmbb.com/math/geometric-sequence.json

## Purpose

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.

**Use when:** 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).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `first_term` | number |  | required | The first term of the sequence. |
| `common_ratio` | number |  | required | Factor between consecutive terms (may be negative or fractional). |
| `n` | integer |  | required | Index of the term to compute and the number of terms to sum. (min 1, max 100000) |

## Output

| Field | 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. |

## 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`

## Data Sources

- Wikipedia – Geometric progression — https://en.wikipedia.org/wiki/Geometric_progression (reference, retrieved 2026-09-23)
- Wikipedia – Geometric series — https://en.wikipedia.org/wiki/Geometric_series (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Geometric Series — https://mathworld.wolfram.com/GeometricSeries.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/geometric-sequence?first_term=…&common_ratio=…&n=…`
- `POST https://tttkmbb.com/api/v1/calculate/geometric-sequence` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/geometric-sequence · OpenAPI operationId `calculate_geometric_sequence` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "geometric-sequence", "inputs": {…}}`

## Example

- 3, 6, 12, … (5 terms): inputs `{"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): inputs `{"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
```

## Limitations

Terms change by a constant difference (use arithmetic-sequence) or you need a money value with periodic deposits (use future-value / compound-interest). All values are computed from the formula above; no measurement or live data is involved.

## 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

- [Arithmetic Sequence Calculator](https://tttkmbb.com/math/arithmetic-sequence.md) — Sequences with a constant difference.
- [Compound Interest Calculator](https://tttkmbb.com/finance/compound-interest.md) — Compound growth is a geometric sequence in the balance.
- [Exponent Calculator](https://tttkmbb.com/math/exponent.md) — The power rⁿ used in the formulas.
