Computer Science
40 cents

# Write a program in python to print the following series:- 2,5,8,11,14,17,20,23​

The time for answering the question is over

Your input 2,5,8,11,14,17,20,23 appears to be an arithmetic sequence

Find the difference between the members

a2-a1=5-2=3

a3-a2=8-5=3

a4-a3=11-8=3

a5-a4=14-11=3

a6-a5=17-14=3

a7-a6=20-17=3

a8-a7=23-20=3

The difference between every two adjacent members of the series is constant and equal to 3

General Form: an=a1+(n-1)d

an=2+(n-1)3

a1=2   (this is the 1st member)

an=23  (this is the last/nth member)

d=3  (this is the difference between consecutive members)

n=8  (this is the number of members)

Sum of finite series members

The sum of the members of a finite arithmetic progression is called an arithmetic series.

Using our example, consider the sum:

2+5+8+11+14+17+20+23

This sum can be found quickly by taking the number n of terms being added (here 8), multiplying by the sum of the first and last number in the progression (here 2 + 23 = 25), and dividing by 2:

n(a1+an)2

8(2+23)

2

The sum of the 8 members of this series is 100

This series corresponds to the following straight line y=3x+2

235