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/sum_of_squares_fn.py

Code

import cp_library.math.series.__header__

def sum_of_squares(n):
    return n * (n + 1) * (2*n+1) // 6
'''
╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
             https://kobejean.github.io/cp-library               
'''

def sum_of_squares(n):
    return n * (n + 1) * (2*n+1) // 6
Back to top page