#include<cstdio>
#include<cstdlib>
#define M 500001
int a[M];
int main()
{
int i,j,t,n,tcase;
for(i=0;i<=M;i++)
a[i]=1;
t=M/2;
for(i=2;i<=t;i++)
for(j=i+i;j<M;j+=i)
a[j]+=i;
while(scanf("%d",&tcase)!=EOF)
{
while(tcase--)
{ scanf("%d",&n);
printf("%d\n",a[n]);}
}
return 0;
}