fork(1) download
  1. def soma_progressao_aritmetica(n, a1, q):
  2. return a1 * (q**n - 1) / (q - 1)
  3.  
  4. print(soma_progressao_aritmetica(n=7, a1=1, q=3))
Success #stdin #stdout 0.04s 9404KB
stdin
Standard input is empty
stdout
1093.0