The K-th Squarefree Number — Solution & Editorial
The count of squarefree numbers ≤ x is ∑d μ(d)⌊x/d²⌋, computable in O(√x) with a precomputed Möbius sieve. Binary search for the smallest x whose count reaches K.
Complexity: O(√x log)
The count of squarefree numbers ≤ x is ∑d μ(d)⌊x/d²⌋, computable in O(√x) with a precomputed Möbius sieve. Binary search for the smallest x whose count reaches K.
Complexity: O(√x log)