Groups
Category
A sqrt tree is a layered block-decomposition data structure that answers range queries in O(1) time after O(n \log \log n) preprocessing.
Summing the divisor function d(i) up to n equals counting lattice points under the hyperbola xy ≤ n, which can be done in O(√n) using floor-division blocks.