#include #include using namespace std; #define reps(i,s,n) for(int i = s; i < n; i++) #define rep(i,n) reps(i,0,n) #define Rreps(i,n,e) for(int i = n - 1; i >= e; --i) #define Rrep(i,n) Rreps(i,n,0) #define ALL(a) a.begin(), a.end() #define fi first #define se second typedef long long ll; typedef vector vec; typedef vector mat; ll N,M,H,W,K,Q,A,B; string S; const ll MOD = 998244353; //const ll MOD = (1e+9) + 7; const ll INF = 1LL<<60; typedef pair P; ll extgcd(ll a, ll b, ll &x, ll &y){ ll d = a; if(b != 0){ d = extgcd(b, a%b, y, x); y -= (a/b) * x; }else{ x=1; y=0; } return d; } ll fastpow(ll a, ll pw) { ll res = 1; while (pw) { if(a > 1e+9) return 2e+9; if (pw & 1) res = res * a; a = a * a; pw >>= 1; } return res; } ll solve(ll n){ ll res = n * n + (n - 1) * n; reps(b, 2, min(31LL, n + 1)){ reps(d, 1, b){ ll x, y; if(extgcd(b, d, x, y) == 1) { reps(tn, 2, 32000) { ll c = fastpow(tn, b); if(c > n) break; res += 2 * (n / b); } } } } return res; } int main() { cin>>Q; rep(i,Q){ cin>>N; cout<