# Máy tính cấp số cộng, cấp số nhân và dãy Fibonacci

> The nth term and the sum of the first n terms of an arithmetic or geometric sequence, the sum to infinity, and exact Fibonacci numbers, with a table.

Phiên bản tương tác: https://www.calcopenly.com/vi/math/sequence-calculator
Chủ đề: Máy tính toán học

An arithmetic sequence adds a fixed difference d at each step, so aₙ = a₁ + (n − 1)d and the first n terms sum to Sₙ = n(a₁ + aₙ)/2. A geometric sequence multiplies by a fixed ratio r, so aₙ = a₁rⁿ⁻¹ and Sₙ = a₁(1 − rⁿ)/(1 − r); when |r| < 1 the sum to infinity is a₁/(1 − r). Fibonacci numbers start from F₀ = 0 and F₁ = 1, add the previous two, and are computed exactly to every digit.

Savings that grow by a fixed amount, compound growth and exam questions all use these formulas. The default, 3, 7, 11, …, reaches 39 at term 10, and those 10 terms sum to 210; the halving series 1 + 1/2 + 1/4 + … totals 1.998046875 after 10 terms and approaches 2.

A geometric series with |r| ≥ 1 has no finite sum to infinity, and an arithmetic series has one only when every term is 0. The Fibonacci sum F₁ + … + Fₙ equals Fₙ₊₂ − 1.

## Dữ liệu đầu vào

- **Sequence** (lựa chọn: Số học, Geometric, Fibonacci)
- **First term a₁**
- **Common difference d**
- **Common ratio r**
- **Term number n**: Fibonacci counts from F₀ = 0, F₁ = 1; the others from a₁.

## Kết quả

- nth term — kết quả chính
- Sum of the first n terms
- Sum to infinity
- nth term, all digits
- Digits in the term

## Công thức

$$
\begin{gathered} a_n = a_1 + (n-1)d \\ S_n = \tfrac{n}{2}(a_1 + a_n) \\[10pt] a_n = a_1 r^{n-1} \\ S_n = a_1\frac{1 - r^n}{1 - r},\quad S_\infty = \frac{a_1}{1 - r} \\[10pt] F_n = F_{n-1} + F_{n-2} \end{gathered}
$$

## Ví dụ có lời giải

### Arithmetic 3, 7, 11, … to 10 terms

- Sequence: Số học
- First term a₁: 3
- Common difference d: 4
- Term number n: 10
- **nth term: 39**
- **Sum of the first n terms: 210**
- Nguồn đối chiếu: Python 3.8: sum(3 + 4k for k in range(10)) = 210, last term 39

### Arithmetic with a negative step

- Sequence: Số học
- First term a₁: 100
- Common difference d: -7.5
- Term number n: 20
- **nth term: -42.5**
- **Sum of the first n terms: 575**
- Nguồn đối chiếu: Python 3.8 decimal loop over 20 terms (forkA/verify_seq.py)

### Geometric 2, 6, 18, … to 6 terms

- Sequence: Geometric
- First term a₁: 2
- Common ratio r: 3
- Term number n: 6
- **nth term: 486**
- **Sum of the first n terms: 728**
- Nguồn đối chiếu: Python 3.8: 2·3⁵ = 486, Σ 2·3^k (k < 6) = 728

### Halving series 1 + 1/2 + 1/4 + …

- Sequence: Geometric
- First term a₁: 1
- Common ratio r: 0.5
- Term number n: 10
- **nth term: 0.001953125**
- **Sum of the first n terms: 1.998046875**
- **Sum to infinity: 2**
- Nguồn đối chiếu: Python fractions: Σ (1/2)^k for k < 10 = 1023/512; sum to infinity 1/(1 − 1/2) = 2

### Ratio 1 (edge)

- Sequence: Geometric
- First term a₁: 5
- Common ratio r: 1
- Term number n: 4
- **nth term: 5**
- **Sum of the first n terms: 20**
- Nguồn đối chiếu: With r = 1 every term is a₁, so Sₙ = n·a₁ = 20

### Fibonacci F₁₀₀

- Sequence: Fibonacci
- Term number n: 100
- **nth term: 3.54225 × 10²⁰**
- **nth term, all digits: 354224848179261915075**
- **Digits in the term: 21**
- **Sum of the first n terms: 9.27373 × 10²⁰**
- Nguồn đối chiếu: OEIS A000045 (F₁₀₀); sum F₁₀₂ − 1 from a Python 3.8 loop

## Câu hỏi

### How do you find the nth term of an arithmetic sequence?

Use aₙ = a₁ + (n − 1)d: start from the first term and add the common difference n − 1 times. For 3, 7, 11, … the difference is 4, so the 10th term is 3 + 9 × 4 = 39 and the 50th is 3 + 49 × 4 = 199. To find d from two terms, divide their difference by the gap in positions: (39 − 3)/(10 − 1) = 4.

### What is the formula for the sum of an arithmetic series?

Sₙ = n(a₁ + aₙ)/2, the number of terms times the average of the first and last term. For 3 + 7 + … + 39, which has 10 terms, S = 10 × (3 + 39)/2 = 210. The pairing idea behind it is often credited to the young Gauss, who summed 1 to 100 as 50 pairs of 101 to get 5,050.

### How do you find the sum of a geometric series?

For n terms, Sₙ = a₁(1 − rⁿ)/(1 − r) whenever r ≠ 1. For 2 + 6 + 18 + … with 6 terms, S = 2 × (1 − 3⁶)/(1 − 3) = 2 × (−728)/(−2) = 728. When r = 1 every term equals a₁, so Sₙ = n × a₁ and 5 + 5 + 5 + 5 = 20.

### When does a geometric series have a sum to infinity?

Only when the common ratio is strictly between −1 and 1. Then rⁿ shrinks toward 0 and the sum approaches a₁/(1 − r): 1 + 1/2 + 1/4 + … = 1/(1 − 1/2) = 2, and 0.9 + 0.09 + 0.009 + … = 0.9/(1 − 0.1) = 1, which is why 0.999… equals 1. With |r| ≥ 1 the terms do not shrink, so the series grows without bound or oscillates.

### What is the 100th Fibonacci number?

F₁₀₀ = 354,224,848,179,261,915,075, a 21-digit number, counting from F₀ = 0 and F₁ = 1 as in OEIS A000045. Consecutive Fibonacci numbers grow by a factor approaching the golden ratio φ ≈ 1.618034, so Fₙ is close to φⁿ/√5 and each term adds about 0.209 digits.

### “Máy tính cấp số cộng, cấp số nhân và dãy Fibonacci” chính xác đến mức nào?

Độ chính xác phụ thuộc vào dữ liệu nhập và giả định của phương pháp. Phép tính thập phân dùng 50 chữ số có nghĩa, nhưng ước lượng, phương pháp số và dữ liệu nguồn có thể kém chính xác hơn; làm tròn khi hiển thị không loại bỏ các giới hạn đó. Ví dụ có lời giải đã đối chiếu với nguồn độc lập: 7. Ví dụ, “Arithmetic 3, 7, 11, … to 10 terms” được kiểm tra bằng Python 3.8: sum(3 + 4k for k in range(10)) = 210, last term 39.

### Phương pháp này lấy từ đâu?

Abramowitz & Stegun, Handbook of Mathematical Functions, §3.6 (series); OEIS A000045 — Fibonacci numbers; Wikipedia — Geometric series.

## Nguồn

- Abramowitz & Stegun, Handbook of Mathematical Functions, §3.6 (series)
- [OEIS A000045 — Fibonacci numbers](https://oeis.org/A000045)
- [Wikipedia — Geometric series](https://en.wikipedia.org/wiki/Geometric_series)
