Concepts2
∑MathAdvanced
Floor Sum Formula
The floor sum computes S(n,m,a,b) = sum_{i=0}^{n-1} floor((a i + b)/m) efficiently in O(log(min(a,m))) time.
#floor sum#atcoder library#euclidean algorithm+12
∑MathIntermediate
Legendre's Formula
Legendre's formula gives the exponent of a prime p in n! by summing how many multiples of p, p^2, p^3, ... are ≤ n.
#legendre's formula#p-adic valuation#binomial divisibility+10