Power sequence (2.5 points)¶
Write the function growth() that takes a base number b (int) and a total t (float) and returns the sum of the first powers of b (beginning with \(b^1\)) that are less than or equal to the 5% of t.
Save this function to file p3.py.
Examples:
>>> growth(2, 100)
6
>>> growth(4, 1000)
20
>>> growth(3, 1503.56)
39
>>> growth(10, 19500.5)
110
Note
These tests are provided in file test-sequence.txt.