Let us clarify few terms first.

A **sequence** is a set of numbers written in a particular order.

A **series** is something we obtain from a sequence by adding all the terms together. Please note its not sequence of numbers, its sum of numbers in sequence.

A **progression** has a specific formula to calculate its nth term, whereas a sequence can be based on a logical rule like ‘a group of prime numbers

Here is an example of sequence

${u}_{1},{u}_{2},{u}_{3,.....,}{u}_{n}$

Example of Series

${u}_{1}+{u}_{2}+{u}_{3}+.....+{u}_{n}$### Arithmetic Series

Arithmetic sequence is a sequence of numbers in which each term after the first is obtained by adding a constant (d).

An arithmetic progression is given by following formula

$a,(a+d),(a+2d),(a+3d),....(a+(n\u20131\left)d\right)$

where a = the first term , d = the common difference

Some of the important formulae

$Tofind{n}^{th}Term:{a}_{n}=a+(n\u20131)d\phantom{\rule{0ex}{0ex}}Tofindlenght:n=\frac{(lastterm-firstterm)}{d}+1\phantom{\rule{0ex}{0ex}}TofindSumtillnthElement:{S}_{n}=\frac{1}{2n}(firstterm+lastterm)$### Geometric Progression

A geometric progression, or GP, is a sequence where each new term after the first is obtained by multiplying the preceding term by a constant r.

$a,ar,a{r}^{2},a{r}^{3},...,a{r}^{(n\u20131)}$

Where a : first term and r is constant

$Tofind{n}^{th}Term:{a}_{n}=a{r}^{(n\u20131)}\phantom{\rule{0ex}{0ex}}TofindSumtillnthElement:{S}_{n}=\frac{a(1\u2013{r}^{n})}{(1\u2013r)}$### Harmonic Progression

harmonic progression is closely related with arithmetic progression. Non-zero numbers

${a}_{1},{a}_{2},{a}_{3},...,{a}_{n}$

are in Harmonic Progression(HP) if

$\frac{1}{{a}_{1}},\frac{1}{{a}_{2}},\frac{1}{{a}_{3}},...,\frac{1}{{a}_{n}}$are in Arithmetic progression

### Python program to identify type of progression

```
################################################################################################
# name: progression.py
# desc: identify type of progression
# date: 2018-09-08
# Author: conquistadorjd
################################################################################################
import numpy
def type_of_progression(input_sequence):
delta = []
current = 0
while current < len(input_sequence)-1:
delta.append(input_sequence[current+1]-input_sequence[current])
current = current+1
delta_unique= set(delta)
if len(delta_unique) == 1 :
return "arithmetic"
delta = []
current = 0
while current < len(input_sequence)-1:
delta.append(input_sequence[current+1]/input_sequence[current])
current = current+1
delta_unique= set(delta)
if len(delta_unique) == 1 :
return "geometric"
delta = []
current = 0
while current < len(input_sequence)-1:
delta.append(1/input_sequence[current+1]-1/input_sequence[current])
current = current+1
delta_unique= set(delta)
if len(delta_unique) == 1 :
return "harmonic"
else:
return "nothing"
print('*** Program Started ***')
input_sequence = input('Please input sequence separated by "," : ')
input_sequence = eval('[' + input_sequence + ']')
result = type_of_progression(input_sequence)
print("result :" , result)
print('*** Program Ended ***')
```