Non-Squarefree Numbers
Time limit2sMemory limit32 MB
Given n up to 10^10, find the n-th positive integer that is divisible by some square d^2 with d > 1.
- Level
Hard8 of 10
- Topics
- Binary search, Math, Number theory, Combinatorics
- Solved
- No attempts yet
Problem
A positive integer is called squarefree if it is not divisible by for any integer . Conversely, is called non-squarefree if there exists an integer such that divides .
For example, listing the non-squarefree numbers in increasing order gives .
Print the -th non-squarefree number when they are listed in increasing order.
Input
The first line contains an integer ().
Output
Print the -th non-squarefree number on a single line.