Gauss's sum
- Input
- a₁=1, d=1, n=100
- Expected output
- a₁₀₀ = 100 · S₁₀₀ = 5050
The legend of the sum Gauss is said to have done in his head: 50 pairs each summing 101, or straight from the formula, 100·(1+100) ÷ 2 = 5,050.
arithmetic progression
In an AP, the difference between consecutive terms is always the same, the common difference d. Two formulas solve almost everything: one finds any term without listing the whole sequence, the other sums a block of terms without adding them one by one.
The legend of the sum Gauss is said to have done in his head: 50 pairs each summing 101, or straight from the formula, 100·(1+100) ÷ 2 = 5,050.
a₁₂ = 5 + 11×3 = 38, and S₁₂ = 12·(5+38) ÷ 2 = 258, applying both formulas with a common difference other than 1.
With a negative common difference the AP decreases: 50, 46, 42… down to 22 at the 8th term, and the sum still comes from the same formula, S₈ = 8·(50+22) ÷ 2 = 288.
In an AP we add a constant difference to each term (linear growth). In a GP we multiply by a constant ratio (exponential growth). AP: 2, 5, 8, 11… (d = 3). GP: 2, 6, 18, 54… (r = 3).
From repeatedly pairing the first term with the last: in 1 to 100, 1+100=101, 2+99=101, and so on for 50 pairs summing 101, totaling 5,050, the same value that n·(a₁+aₙ) ÷ 2 = 100×101 ÷ 2 = 5,050 gives directly.
Yes; with a₁ = 50 and d = −4 the sequence decreases, 50, 46, 42…, reaching 22 at the 8th term, with a sum of 288, using the same aₙ and Sₙ formulas as a growing AP.
Check whether the difference between consecutive terms is constant: in 5, 8, 11, 14 the difference is always 3, which confirms d = 3 and identifies the sequence as an AP.
Calculations run in your browser. No data is sent to a server.