Count Cubes in a Range — Solution & Editorial
Prefix counting: (how many ≤ R) − (how many ≤ L−1); the count-up-to function inverts the sequence's closed form (integer roots, bit length, or a precomputed list).
Complexity: O(1) or O(log)
Watch out: Everything must be exact integer arithmetic — floating-point roots drift at 1018.