Python Program to print Geometric Progress series

Python Program to print Geometric Progress series 

In this, we discuss the GP series with example and also discuss how to print Geometric series in Python Programming. First of all we learn about the definition of GP.

So this case, first of all we have to follow these steps to write the code.
GP Series (Geometric Progress) 
Given the first term (a), the general ratio (r) and the integer of the geometric progression series n, print the n terms of the work series.

Examples:

Input: a = 2 r = 2, n = 4
Output: 2 4 8 16

If you are new to Programming then i will suggest you to learn first some basic of the Python Programming. If you already know programming then you can skip these steps.

1. Introduction of Python
2. Basics of Python


Python GP Series

A geometric array is an array of elements in which the next item obtained by multiplying the normal ration by the previous object. Or G.P. A series is a series of numbers in which the general ratio of any series of numbers (elements) is always the same.


The mathematical formula behind this whole of the G.P series


Sn = a (rn) / (1- r)
Tn = ar (n-1)

let's take a look at how to print the Geometric Progress series in Python Programming.

Python code:
a = int(input('enter first term'))
r = int(input('enter common difference'))
n = int(input('enter number of terms'))
print('AP series as follows')
m = 1while(m<=n):
    tm = a * r**(m-1)
    print(tm)
    m = m+1
Output:
enter first term 1
enter common difference 2
enter number of terms 6
AP series as follows
1
2
4
8
16
32