import math t = int(input()) ni = [int(input()) for i in range(t)] def primes(n): is_prime = [True] * (n + 1) is_prime[0] = False is_prime[1] = False for i in range(2, int(n**0.5) + 1): if not is_prime[i]: continue for j in range(i * 2, n + 1, i): is_prime[j] = False return [i for i in range(n + 1) if is_prime[i]] #print(int((10**9+100)**0.5)+1) pri_li = primes(int((10**9)**0.5)+1) for i in range(t): n_num = ni[i] ans = 0 for j in range(len(pri_li)): pri_num = pri_li[j] if pri_num > n_num: break for k in range(1,n_num+1): if k > n_num: break else: tmp = 0 for l in range(1,k+1): #print(pri_num,k,l,tmp) if k % l == 0: if pri_num**l > n_num: break tmp += 1 if tmp <= 1: continue #print(ans) ans += math.factorial(tmp) #print(pri_num,k,l,tmp,ans) #print(ans) print(ans+n_num*(2*n_num-1))