Arithmetic and geometric progression

Calculate nth term and sum in arithmetic and geometric progression.

{{ t("mathProgressionArithmeticHelp") }}

{{ t("mathProgressionGeometricHelp") }}

{{ progressionCalc.message }}

Overview

Arithmetic and geometric progressions are structures so ancient they appear in Egyptian papyri from the second millennium BC. The Ahmes Papyrus (also known as the Rhind Papyrus), written around 1650 BC and now held at the British Museum, contains division problems that use arithmetic series. But the most famous story about arithmetic progression is that of Carl Friedrich Gauss: according to the account, when Gauss was about 10 years old (around 1787), his teacher asked the class to sum the numbers from 1 to 100, expecting to occupy the entire lesson. Gauss delivered the answer in seconds: he noticed that 1+100 = 2+99 = 3+98 = ... = 101, and since there are 50 such pairs, the sum is 50 × 101 = 5,050. That insight is exactly the formula Sn = n(a1 + an)/2 we still use today.

Geometric progression has a property that seems magical until you understand it: exponential growth. The most famous example is the chess inventor story — the legend, of Arab or Indian origin, tells that the king offered any reward to the game's inventor. He asked for one grain of wheat on the first square, two on the second, four on the third, and so on, doubling each square. The king laughed, thinking it cheap. By the 64th square there would be 2^63 grains, equivalent to about 1,000 years of global wheat production. Compound interest is a geometric progression: if you invest $1,000 at 1% per month, after 12 months you have $1,000 × 1.01^12 ≈ $1,126.83 — the ratio is 1.01. The Fibonacci sequence (1, 1, 2, 3, 5, 8, 13, ...) is not a perfect GP, but the ratio between consecutive terms converges to φ = (1 + √5)/2 ≈ 1.618 — the golden ratio, which appears in nautilus shells, sunflower heads, and the architecture of the Parthenon.

For programmers, progressions appear everywhere without us stopping to name them. A `for i in range(0, 100, 5)` loop is an AP with a1=0, d=5. Exponential backoff in API calls — wait 1s, then 2s, then 4s, then 8s — is a GP with ratio 2. A database table's growth can be arithmetic (constant daily inserts) or geometric (viral traffic). Big O notation in computer science directly reflects progressions: O(n) grows like an AP, O(2^n) grows like a GP. And there is a fascinating fact about GP: if you could fold an A4 sheet of paper (thickness 0.1 mm) 42 times, the stack would be 0.1 × 2^42 mm ≈ 439,804 km tall — enough to go to the Moon and back. This tool calculates the nth term and the sum of the first n terms for both AP and GP.

Technical deep dive

Common questions summarized

  • What is this tool for?: It runs fully in your browser: useful to validate, format, or convert data in everyday development.
  • Are my inputs sent to a server?: Processing happens locally with JavaScript. We do not store what you paste into the text areas.
  • Can I use this for real production data?: Use at your own risk. For secrets (passwords, tokens), prefer controlled environments and your company policies. And always review the generated contents. Never trust blindly things you see on the internet.

Sample payload to try

  • See also the larger "Code Snippets" sample; paste this excerpt to try locally: Example — PA: a1=2, r=3, n=5 an=14, Sn=40

Code Snippets

Code example
PA: a1=2, r=3, n=5
an=14, Sn=40

Example

PA: a1=2, r=3, n=5
an=14, Sn=40

FAQ

What is this tool for?

It runs fully in your browser: useful to validate, format, or convert data in everyday development.

Are my inputs sent to a server?

Processing happens locally with JavaScript. We do not store what you paste into the text areas.

Can I use this for real production data?

Use at your own risk. For secrets (passwords, tokens), prefer controlled environments and your company policies. And always review the generated contents. Never trust blindly things you see on the internet.