An arithmetic sequence or progression is defined as a sequence of numbers in which the difference between one term and the next term remains constant.
For example: the given below sequence has a common difference of 1.
1 2 3 4 5 . . . n
⇑ ⇑ ⇑ ⇑ ⇑ . . .
1st 2nd 3rd 4th 5th . . . nth Terms
The Arithmetic Sequence can be represented as:
Arithmetic Sequence / Arithmetic ProgresionThe above image has a common difference of 2.
Note: A negative common difference causes the sequence to decrease, and this is entirely valid in an arithmetic progression (AP).
The general formula to find the nth term of an arithmetic sequence is:
an = a1 + (n − 1) ⋅ d
Where:
- an = nth term,
- a = first term,
- d = common difference,
- n = term number.
Example: Nth Term of Arithmetic Sequence
Let's consider an example of Arithmetic Sequence 6, 16, 26, 36, 46, 56, 66, . . .
Term (n) | Expression | Value |
---|
a1 | 6 + (1 - 1) ⋅ 10 | 6 |
a2 | 6 + (2 -1) ⋅ 10 = 6 + 10 | 16 |
a3 | 6 + (3 − 1) ⋅ 10 = 6 + 10 + 10 | 26 |
a4 | 6 + (4 - 1) ⋅ 10 = 6 + 10 + 10 + 10 | 36 |
a5 | 6 + (5 − 1) ⋅ 10 = 6 + 10 + 10 + 10 + 10 | 46 |
a6 | 6 + (6 - 1) ⋅ 10 = 6 + 10 + 10 + 10 + 10 + 10 | 56 |
a7 | 6 + (7 − 1) ⋅ 10 = 6 + 10 + 10 + 10 + 10 + 10 + 10 | 66 |
General Formula for the above sequence:
Substituting the values a = 6 and d = 10 into the formula:
an = 6 + (n - 1) × 10
This formula can be used to find any term of the sequence directly. For example:
- a10 = 6 + (10 − 1) ⋅ 10 = 6 + 90 = 96,
- a22 = 6 + (22 − 1) ⋅ 10 = 6 + 210 = 216.
Examples of Arithmetic Sequence
Here are some examples of arithmetic sequences,
1. Sequence of Natural Numbers
1, 2, 3, 4, 5, 6, . . .
- First term a1 = 1
- Common difference (d): 2 - 1 = 1.
2. Sequence of Even Numbers
2, 4, 6, 8, 10, 12, . . .
- First term a1 = 2
- Common difference (d): 4 - 2 = 2.
3. Sequence of Odd Numbers
1, 3, 5, 7, 9, 11, . . .
- First term a1 = 1
- Common difference (d): 3 - 1 = 2.
4. Negative Arithmetic Sequence:
−5, −10, −15, −20, -25, -30, . . .
- First term a1 = -5
- Common difference (d): -10 - (-5) = -10 + 5 = -5.
Read more: How to Find the Nth term of Arithmetic Sequence?
Sum of terms in Arithmetic Sequence
The sum of terms of an Arithmetic Sequence is calledan Arithmetic Series.
Suppose the first term of the arithmetic series is a and the common difference is d then the sum of the n term of this arithmetic series is given using the formula,
Sn= n/2 [2a + (n - 1)d]
If the common difference of the arithmetic series is not given but the last term of the series is given (say l). Then its sum is calculated as,
Sn= n/2 [a + l]
Example: A tree fruits five apples in the first year and at each successive year it has 2 more apples than the last year find the total apple the tree bears at the end of six years.
Solution:
Apple bear by tree in first year (a) = 5
Yearly Increase in apple bear by the tree (d) = 2
Time Period = 6 years
Total apple at the end of five years in the tree.
Sn = n/2 [2a + (n-1)d]
⇒ Sn = 6/2(2(5) + (6 - 1)(2))
⇒ Sn = 6/2 (10 + 10)
⇒ Sn = 3(20)
⇒ Sn = 60
Thus, the apple in the tree at the end of six-year is 60 apples
The nth term of an Arithmetic Sequence can be defined recursively as the next term can always be obtained by adding a common difference to the preceding term, the following derivation can be used to illustrate the same thing.
As we know, nth term of the Arithmetic Sequence is given by
an = a + (n - 1) × d
thus, (n - 1)th term can be given by
an-1 = a + (n - 1 - 1) × d
an-1 = a + (n - 2) × d
Thus,
an = a + (n - 1) × d
⇒ an = a + (n - 1 - 1 + 1) × d
⇒ an = a + (n - 2 + 1) × d
⇒ an = a + (n - 2) × d + d
⇒ an = an-1 + d
The notations used in arithmetic progression are :
The following table contains formulas related to Arithmetic Progression.
Common Difference | an+1 - an = d |
---|
General Form of AP | a, a + d, a + 2d, a + 3d, . . . |
---|
nth term of AP | an = a + (n – 1) × d |
---|
Sum of n terms in AP | S = n/2[2a + (n − 1) × d] |
---|
Sum of all terms in a finite AP with the last term as ‘l’ | n/2(a + l) |
---|
Solved Problems on Arithmetic Sequence
Question 1: Find the AP if the first term is 15 and the common difference is 4.
Solution:
As we know,
a, a + d, a + 2d, a + 3d, a + 4d, …
Here, a = 15 and d = 4
= 15, (15 + 4), (15 + 2 × 4), (15 + 3 × 4), (15 + 4 × 4),
= 15, 19, (15 + 8), (15 + 12), (15 + 16), …
= 15, 19, 23, 27, 31, …and so on.
So the AP is 15, 19, 23, 27, 31...
Question 2: Find the 20th term for the given AP: 3, 5, 7, 9, …
Solution:
Given, 3, 5, 7, 9, 11, . . .
a = 3, d = 5 – 3 = 2, n = 20
Thus, an = a + (n − 1)d
⇒ a20 = 3 + (20 − 1)2
⇒ a20 = 3 + 38
⇒ a20 = 41
Here 20th term is a20 = 41
Question 3: Find the sum of the first 20 multiples of 5.
Solution:
First 20 multiples of 5 are 5, 10, 15, . . . , 100.
Here, it is clear that the sequence formed is an AP where,
a = 5, d = 5, an = 100, n = 20.
Thus, Sn = n/2 [2a + (n − 1) d]
⇒ Sn = 20/2 [2 × 5 + (20 − 1)5]
⇒ Sn = 10 [10 + 95]
⇒ Sn = 1050
People Also Read:
Similar Reads
Basics & Prerequisites
Data Structures
Array Data StructureIn this article, we introduce array, implementation in different popular languages, its basic operations and commonly seen problems / interview questions. An array stores items (in case of C/C++ and Java Primitive Arrays) or their references (in case of Python, JS, Java Non-Primitive) at contiguous
3 min read
String in Data StructureA string is a sequence of characters. The following facts make string an interesting data structure.Small set of elements. Unlike normal array, strings typically have smaller set of items. For example, lowercase English alphabet has only 26 characters. ASCII has only 256 characters.Strings are immut
2 min read
Hashing in Data StructureHashing is a technique used in data structures that efficiently stores and retrieves data in a way that allows for quick access. Hashing involves mapping data to a specific index in a hash table (an array of items) using a hash function. It enables fast retrieval of information based on its key. The
2 min read
Linked List Data StructureA linked list is a fundamental data structure in computer science. It mainly allows efficient insertion and deletion operations compared to arrays. Like arrays, it is also used to implement other data structures like stack, queue and deque. Hereâs the comparison of Linked List vs Arrays Linked List:
2 min read
Stack Data StructureA Stack is a linear data structure that follows a particular order in which the operations are performed. The order may be LIFO(Last In First Out) or FILO(First In Last Out). LIFO implies that the element that is inserted last, comes out first and FILO implies that the element that is inserted first
2 min read
Queue Data StructureA Queue Data Structure is a fundamental concept in computer science used for storing and managing data in a specific order. It follows the principle of "First in, First out" (FIFO), where the first element added to the queue is the first one to be removed. It is used as a buffer in computer systems
2 min read
Tree Data StructureTree Data Structure is a non-linear data structure in which a collection of elements known as nodes are connected to each other via edges such that there exists exactly one path between any two nodes. Types of TreeBinary Tree : Every node has at most two childrenTernary Tree : Every node has at most
4 min read
Graph Data StructureGraph Data Structure is a collection of nodes connected by edges. It's used to represent relationships between different entities. If you are looking for topic-wise list of problems on different topics like DFS, BFS, Topological Sort, Shortest Path, etc., please refer to Graph Algorithms. Basics of
3 min read
Trie Data StructureThe Trie data structure is a tree-like structure used for storing a dynamic set of strings. It allows for efficient retrieval and storage of keys, making it highly effective in handling large datasets. Trie supports operations such as insertion, search, deletion of keys, and prefix searches. In this
15+ min read
Algorithms
Searching AlgorithmsSearching algorithms are essential tools in computer science used to locate specific items within a collection of data. In this tutorial, we are mainly going to focus upon searching in an array. When we search an item in an array, there are two most common algorithms used based on the type of input
2 min read
Sorting AlgorithmsA Sorting Algorithm is used to rearrange a given array or list of elements in an order. For example, a given array [10, 20, 5, 2] becomes [2, 5, 10, 20] after sorting in increasing order and becomes [20, 10, 5, 2] after sorting in decreasing order. There exist different sorting algorithms for differ
3 min read
Introduction to RecursionThe process in which a function calls itself directly or indirectly is called recursion and the corresponding function is called a recursive function. A recursive algorithm takes one step toward solution and then recursively call itself to further move. The algorithm stops once we reach the solution
14 min read
Greedy AlgorithmsGreedy algorithms are a class of algorithms that make locally optimal choices at each step with the hope of finding a global optimum solution. At every step of the algorithm, we make a choice that looks the best at the moment. To make the choice, we sometimes sort the array so that we can always get
3 min read
Graph AlgorithmsGraph is a non-linear data structure like tree data structure. The limitation of tree is, it can only represent hierarchical data. For situations where nodes or vertices are randomly connected with each other other, we use Graph. Example situations where we use graph data structure are, a social net
3 min read
Dynamic Programming or DPDynamic Programming is an algorithmic technique with the following properties.It is mainly an optimization over plain recursion. Wherever we see a recursive solution that has repeated calls for the same inputs, we can optimize it using Dynamic Programming. The idea is to simply store the results of
3 min read
Bitwise AlgorithmsBitwise algorithms in Data Structures and Algorithms (DSA) involve manipulating individual bits of binary representations of numbers to perform operations efficiently. These algorithms utilize bitwise operators like AND, OR, XOR, NOT, Left Shift, and Right Shift.BasicsIntroduction to Bitwise Algorit
4 min read
Advanced
Segment TreeSegment Tree is a data structure that allows efficient querying and updating of intervals or segments of an array. It is particularly useful for problems involving range queries, such as finding the sum, minimum, maximum, or any other operation over a specific range of elements in an array. The tree
3 min read
Pattern SearchingPattern searching algorithms are essential tools in computer science and data processing. These algorithms are designed to efficiently find a particular pattern within a larger set of data. Patten SearchingImportant Pattern Searching Algorithms:Naive String Matching : A Simple Algorithm that works i
2 min read
GeometryGeometry is a branch of mathematics that studies the properties, measurements, and relationships of points, lines, angles, surfaces, and solids. From basic lines and angles to complex structures, it helps us understand the world around us.Geometry for Students and BeginnersThis section covers key br
2 min read
Interview Preparation
Practice Problem