Maths for Computing
(R/618/7421)
Introduction to Sequence & Series
Use Applied Number Theory In Practical Computing Scenarios
O. K. B. Kavsilu
BSc. (Hons.) (Kingston, UK), Cert. in IT (BCS, UK)
What Is a Sequence?
• A sequence is an ordered list of numbers following a specific rule.
• Each number in the sequence is called a term, often denoted as aₙ.
• Examples:
• 2, 5, 8, 11, 14, ... (Add 3 each time)
• 3, 6, 12, 24, ... (Multiply by 2)
• 0, 1, 1, 2, 3, 5, 8, ... (Add previous two terms)
What Is a Series?
• A series is the sum of the terms of a sequence.
• If a sequence is: a₁, a₂, a₃, ...
Then the series is:
S = a₁ + a₂ + a₃ + ...
• Examples:
• Sequence: 1, 2, 3, 4
• Series: 1 + 2 + 3 + 4 = 10
• Notation:
• Series are written using the summation symbol (∑).
• Example: ∑4ₙ₌₁ 𝑛 = 1 + 2 + 3 + 4 = 10
Sequence vs. Series
Feature Sequence Series
Definition Ordered list of numbers Sum of sequence terms
Notation aₙ or {aₙ} Sₙ or ∑aₙ
Focus Individual terms Cumulative total
Example 1, 2, 3, 4 1 + 2 + 3 + 4 = 10
Recursive Sequences
• Recursive Formula: 𝑎ₙ = 𝑎ₙ₋₁ + 𝑑
• A recursive sequence defines each term using the previous
term(s).
• You must know the first term to begin.
• Example:
• a₁ = 2
• aₙ = aₙ₋₁ + 3
• Sequence: 2, 5, 8, 11, ...
Arithmetic Sequences
• A sequence with a common difference (d) between terms.
• General Formula: 𝑎ₙ = 𝑎₁ + (𝑛 − 1)𝑑
Where:
• 𝑎₁ is the 1st term of the series
• 𝑎ₙ is the nth term of the series
• d is the common difference
Examples:
• 2, 5, 8, 11, ... (d = 3, 𝑎₁ = 2)
• 10, 7, 4, 1, ... (d = -3, 𝑎₁ = 10)
Arithmetic Series
• Formula:
𝑛
𝑆ₙ = × (𝑎₁ + 𝑎ₙ)
2
• Alternatively:
𝑛
𝑆ₙ = × [2𝑎₁ + (𝑛 − 1)𝑑]
2
Example:
• For 2 + 5 + 8 + ... (5 terms):
• a₁ = 2, d = 3, n = 5
• a₅ = 2 + 4×3 = 14
• S₅ = 5/2 × (2 + 14) = 40
Geometric Sequences
• A sequence with a constant ratio (r) between terms.
• The common ratio (r) can be obtained by dividing any term by the preceding term.
𝒂𝟐 𝒂𝟑 𝒂𝒏−𝟏
𝒓= = =⋯
𝒂𝟏 𝒂𝟐 𝒂𝒏−𝟐
• General Formula:
𝑎ₙ = 𝑎 × 𝑟ⁿ⁻¹
Where:
• 𝑎 is the 1st term of the series
• 𝑎ₙ is the nth term of the series
• r is the constant ratio
Examples:
• 3, 6, 12, 24, ... (r = 2)
• 16, 8, 4, 2, ... (r = ½)
Geometric Series
• Finite Series Formula:
𝑎(1 − 𝑟ⁿ)
𝑆ₙ = , (𝑟 ≠ 1)
(1 − 𝑟)
• Infinite Series (if |r| < 1):
𝑎
𝑆 =
(1 − 𝑟)
Example:
• a = 3, r = 2, n = 4
• S₄ = 3(1 - 2⁴) / (1 - 2) = 3(1 - 16)/(-1) = 45
Sum to infinity
𝑆𝑛 = 𝑎 + 𝑎𝑟1 + 𝑎𝑟 2 + 𝑎𝑟 3 + …
𝑟𝑆𝑛 = 𝑎𝑟1 + 𝑎𝑟 2 + 𝑎𝑟 3 + 𝑎𝑟 4 …
𝑆𝑛 − 𝑟𝑆𝑛 = 𝑎
𝑆𝑛 1 − 𝑟 = 𝑎
𝑎
𝑆𝑛 =
(1 − 𝑟)
That formula contains the term 𝒓𝒏 (−𝟏 < 𝐫 < 𝟏), and the term value will get closer and closer to zero as 𝒏
gets larger and larger. So, if −𝟏 < 𝐫 < 𝟏, we can say that the ‘sum to infinity’ of a geometric series is
𝒂
𝑺∞ = 𝟏−𝒓 = ∑∞
𝒏=𝟏 𝒂𝒓
𝒏−𝟏 ,|r| < 1
Comparing Arithmetic vs. Geometric
Feature Arithmetic Sequence Geometric Sequence
Rule Add fixed number (d) Multiply by fixed number (r)
Formula (aₙ) a₁ + (n - 1)d a × rⁿ⁻¹
Common Difference Constant addition/subtraction Constant multiplication/division
Example 2, 5, 8, 11, ... (d = 3) 3, 6, 12, 24, ... (r = 2)
Lesson Summary
• A sequence is a list of numbers following a rule.
• A series is the sum of those numbers.
• Arithmetic sequences have a common difference (d).
• Geometric sequences have a common ratio (r).
• You can express a sequence recursively.
• Fibonacci is a famous recursive sequence.
• Sum to infinity only applies to some geometric series.