import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.math.BigInteger; import java.util.Arrays; import java.util.NoSuchElementException; class Main { public static void main(String[] args) { new Main().run(); } long pow(long a,long n) { if(a==0)return 0; long ret=1; for(;n>0;n/=2,a*=a)if(n%2==1)ret*=a; return ret; } long gcd(long a,long b) { if(a>b)return gcd(b,a); if(a==0)return b; return gcd(b%a,a); } long solve(long N) { long ret=(N-1)*N+N*N;//a^b=a^b (a!=1&&b!=1), 1^a=1^b, はすでに含む。 int e=30; int[] cnt=new int[e+1]; for(int u=1;u<=e;++u) { for(int v=1;v<=e;++v) { if(gcd(u,v)!=1||(u==1&&v==1))continue; cnt[Math.max(u, v)]+=N/Math.max(u, v); } } { long x=(long)Math.sqrt(N+1); for(int i=2;i<=e;++i) { while(pow(x,i)>N)--x; ret+=(x-1)*cnt[i]; } } return ret; } void run() { FastScanner sc=new FastScanner(); PrintWriter pw=new PrintWriter(System.out); int T=sc.nextInt(); long[] N=new long[T]; for(int i=0;i