Share your repls and programming experiences

← Back to all posts
Geometric progression
DEMONul1234 (11)

Yet another mathematical usage of Python.

formula:
an = a1 * q^(n-1)

Code example:
a1 = 2, q = 2, a3 = ?
a3 = 2 * 2^(3-1)
a3 = 8