Eddy's爱好

Problem Description
Ignatius 喜欢收集蝴蝶标本和邮票,但是Eddy的爱好很特别,他对数字比较感兴趣,他曾经一度沉迷于素数,而现在他对于一些新的特殊数比较有兴趣。
这些特殊数是这样的:这些数都能表示成M^K,M和K是正整数且K>1。
正当他再度沉迷的时候,他发现不知道什么时候才能知道这样的数字的数量,因此他又求助于你这位聪明的程序员,请你帮他用程序解决这个问题。
为了简化,问题是这样的:给你一个正整数N,确定在1到N之间有多少个可以表示成M^K(K>1)的数。

Input
本题有多组测试数据,每组包含一个整数N,1<=N<=1000000000000000000(10^18).

Output
对于每组输入,请输出在在1到N之间形式如M^K的数的总数。
每组输出占一行。

Sample Input
10
36
1000000000000000000

Sample Output
4
9
1001003332

public class countM_K {
public static void returnNum(Long limit_N){

    long root=Math.round(Math.sqrt(limit_N));
    for(int i=2;i<=root;i++){
        int j=2;
        while(Math.pow(i,j)<limit_N){
            System.out.println("M^N:"+i+"^"+j);
            j++;
        }
    }
}

public static void main(String[] args) {
   returnNum(1000L);
}

}