def soma_progressao_aritmetica(n, a1, q):
return a1 * (q**n - 1) / (q - 1)
print(soma_progressao_aritmetica(n=7, a1=1, q=3))
ZGVmIHNvbWFfcHJvZ3Jlc3Nhb19hcml0bWV0aWNhKG4sIGExLCBxKToKICAgIHJldHVybiBhMSAqIChxKipuIC0gMSkgLyAocSAtIDEpCiAgICAKcHJpbnQoc29tYV9wcm9ncmVzc2FvX2FyaXRtZXRpY2Eobj03LCBhMT0xLCBxPTMpKQ==