import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int t= in.nextInt();
while(t-->0) {
long n = in.nextInt();
System.out.println((long) (n*n*n+n)/2);
}
}
}