The K-th Squarefree Number
binary-search number-theory mobius
A number is squarefree if no perfect square > 1 divides it (1, 2, 3, 5, 6, 7, 10, ...). Print the K-th squarefree number.
Input: one integer K.
Output: the K-th squarefree number.
Constraints:
- 1 ≤ K ≤ 1011
Sample Tests
Input 1
5
Output 1
6
Input 2
1
Output 2
1
Discussion (opens after you solve — no spoilers before)
No comments yet.