```go
package main
import (
"bufio"
"fmt"
"math"
"os"
"strconv"
)
func main() {
scanner := bufio.NewScanner(os.Stdin)
scanner.Split(bufio.ScanWords)
if !scanner.Scan() {
return
}
t, _ := strconv.Atoi(scanner.Text())
mu := make([]int, 65)
mu[1] = 1
for i := 1; i <= 64; i++ {
for j := 2 * i; j <= 64; j += i {
mu[j] -= mu[i]
}
}
out := bufio.NewWriter(os.Stdout)
defer out.Flush()
for i := 0; i < t; i++ {
scanner.Scan()
n, _ := strconv.ParseInt(scanner.Text(), 10, 64)
ans := n - 1
for k := 2; k <= 60; k++ {
if mu[k] != 0 {
root := kthRoot(n, k)
if root >= 2 {
ans += int64(mu[k]) * (root - 1)
}
}
}
fmt.Fprintln(out, ans)
}
}
func kthRoot(n int64, k int) int64 {
if k == 1 {
return n
}
res := int64(math.Pow(float64(n), 1.0/float64(k)))
for power(res, k) > n {
res--
}
for power(res+1, k) <= n {
res++
}
return res
}
func power(base int64, k int) int64 {
if base == 0 {
return 0
}
res := int64(1)
for i := 0; i < k; i++ {
if math.MaxInt64/res < base {
return math.MaxInt64
}
res *= base
}
return res
}
```