cp-library

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub kobejean/cp-library

:warning: cp_library/math/series/geosum_fn.py

Code

import cp_library.math.series.__header__

def geosum(a, r, n):
    return a*n if r == 1 else a*(pow(r,n)-1)//(r-1)
'''
╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
             https://kobejean.github.io/cp-library               
'''

def geosum(a, r, n):
    return a*n if r == 1 else a*(pow(r,n)-1)//(r-1)
Back to top page