Geometric Sum
A geometric progression is a sequence where each next term is made by multiplying the previous one by the same number. Given the first term first_term, the common ratio common_ratio, and the number of terms num_of_terms, calculate the sum of the first num_of_terms terms. Return the resulting number.
Примеры
Ввод
1, 2, 10Вывод
1023Ввод
1, 10, 5Вывод
11111Ввод
0, 2, 10Вывод
0Нужно реализовать
def sum_of_geometric_progression(
first_term: int, common_ratio: int, num_of_terms: int
) -> float:Теги
math
Entre para ver seu histórico de envios
EntrarEntre para usar o AI Mentor
EntrarVisible tests
1
Input
1, 2, 10Expected
10232
Input
1, 10, 5Expected
111113
Input
0, 2, 10Expected
04
Input
1, 0, 10Expected
15
Input
1, 2, 0Expected
06
Input
-1, 2, 10Expected
-1023Focus radio
Paused · SomaFM · Fluid