#include #define ALL(v) std::begin(v),std::end(v) using lint=long long; using ld=long double; int main(){ std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false); std::cout.setf(std::ios_base::fixed);std::cout.precision(15); lint t;std::cin>>t; while(t--){ lint n;std::cin>>n; lint ans=0; lint lg=std::log2(n); for(lint p=1;p<=lg;p++){ for(lint q=1;q<=lg;q++){ if(std::gcd(p,q)!=1)continue; lint r=std::max(p,q); ans+=((lint)std::pow(n,1.0/r)-1)*n/r; }} ans+=n*n; std::cout<