A sequence calculator finds the nth term, the sum and the first terms of an arithmetic or a geometric sequence, and the harmonic number Hₙ. Choose the type, enter the first term and the common difference or ratio, and press the button. The formulas follow the Wikipedia pages on arithmetic progression, geometric progression and the harmonic number, and the work is done in your browser. It serves as an arithmetic sequence calculator, a geometric sequence calculator and a harmonic number calculator.
How to use the sequence calculator
- Choose the type: arithmetic, geometric or harmonic number.
- Enter the first term and the common difference (arithmetic) or common ratio (geometric), and the number of terms n.
- Press Calculate.
Arithmetic sequences
In an arithmetic sequence, each term is the previous one plus a fixed difference d. The page gives the nth term as a₁ + (n − 1)d, and the sum of the first n terms as n times (a₁ + aₙ) divided by 2, which is the number of terms times the average of the first and last. For a₁ = 2, d = 3 and n = 5, the terms are 2, 5, 8, 11, 14, the fifth term is 14 and the sum is 5 × 16 ÷ 2 = 40. For the numbers 1 to 100, the sum is 5,050.
Geometric sequences
In a geometric sequence, each term is the previous one times a fixed ratio r. The page gives the nth term as a times r to the power n − 1, and the examples 2, 6, 18, 54 with ratio 3, and 1, −3, 9, −27, 81, −243 with ratio −3. The sum of the first n terms follows from multiplying the sum by r and subtracting: it is a(1 − rⁿ)/(1 − r) when r is not 1, and na when r is 1. For 2, 6, 18, 54 the sum is 80. The page notes that the series converges only when |r| is less than 1. In that case, the sum of all the terms is a/(1 − r), so 1 + ½ + ¼ + … adds up to 2. The calculator reports that the series has no finite sum when |r| is 1 or more.
Harmonic numbers
The harmonic number Hₙ is the sum 1 + 1/2 + 1/3 + … + 1/n. The Wikipedia page lists H₁ = 1, H₂ = 3/2, H₃ = 11/6 and H₄ = 25/12, and gives H₁₀ as 7381/2520, about 2.92897. The calculator finds the exact fraction for n up to 20 by adding 1/k with exact whole-number arithmetic, and the decimal value for larger n. It also shows the asymptotic approximation from the page, ln n + γ + 1/(2n) − 1/(12n²) + 1/(120n⁴), where γ is the Euler–Mascheroni constant, about 0.5772157. For n = 10 the approximation matches the exact value to six digits. Hₙ grows without bound, but very slowly: H₁,₀₀₀ is only about 7.485.
Choosing the right type
Check the differences between terms. If they are all equal, the sequence is arithmetic. If the ratios between terms are all equal, it is geometric. Savings that grow by a fixed amount each month are arithmetic, and savings that grow by a fixed percentage are geometric. The harmonic numbers are neither: they are sums of the reciprocals of the whole numbers.
Finding a term or a sum quickly
The formulas let you skip the long list. To find the 50th term of 7, 11, 15, …, use 7 + 49 × 4, which is 203, and the sum of the first 50 terms is 50 × (7 + 203) ÷ 2, which is 5,250. For a geometric sequence that starts at 5 and doubles each time, the 10th term is 5 × 2⁹, which is 2,560.
A worked example with a loan or a savings plan
Suppose you save 100 in the first month and increase the deposit by 10 each month. This is an arithmetic sequence with a₁ = 100 and d = 10. After 12 months, the last deposit is 100 + 11 × 10 = 210, and the total saved is 12 × (100 + 210) ÷ 2, which is 1,860. Now suppose a deposit of 100 grows 5 percent a month. The twelfth term of that geometric sequence is 100 × 1.05 to the power 11, about 171.03, and the sum of the 12 terms is 100 × (1.05¹² − 1)/0.05, about 1,591.71. Entering the numbers in the calculator gives the same results.
Why the series matters
Series show up in finance, physics and computing. The present value of a stream of payments is a geometric sum, the distance travelled by a bouncing ball is an infinite geometric series, and the number of steps in many algorithms is a sum of an arithmetic sequence. The harmonic numbers appear in the analysis of sorting algorithms and in the coupon collector problem. Being able to find the sum without listing every term is a basic skill in all of these areas.
Reading the list of terms
The first ten terms are listed so that you can see the pattern. If the pattern is not what you expected, check the sign of the difference or ratio. A negative difference makes an arithmetic sequence fall, and a ratio between 0 and 1 makes a geometric one shrink toward zero.
Common mistakes
- Using n instead of n − 1. The nth term has n − 1 steps from the first.
- Treating a negative ratio as a decay. It makes the terms alternate in sign.
- Applying the infinite sum when |r| is 1 or more. There is no finite sum.
- Confusing the sum with the nth term. They are different quantities.
- Calling the harmonic series geometric. Its terms have no common ratio.
What next
Use this often? Add Sequence to your Home screen.
Frequently asked questions
What is a sequence calculator?
A tool that finds the nth term and the sum of arithmetic and geometric sequences, plus harmonic numbers.
What is the formula for an arithmetic sequence?
aₙ = a₁ + (n − 1)d, and the sum is n(a₁ + aₙ)/2. For 2, 5, 8, 11, 14 the sum is 40.
What is the formula for a geometric sequence?
aₙ = a·rⁿ⁻¹. The sum of n terms is a(1 − rⁿ)/(1 − r). For 2, 6, 18, 54 the sum is 80.
When does an infinite geometric series have a sum?
Only when |r| < 1. The sum is a/(1 − r), so 1 + ½ + ¼ + … = 2.
What is a harmonic number?
Hₙ = 1 + 1/2 + … + 1/n. For example H₄ = 25/12 and H₁₀ ≈ 2.92897.
Sources
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.