#The solution in Python 3 is as follows:
t=int(input())
i=0
while i<t:
n = int(input())
print ((n*(n+1)*(n+2))//2)
i+=1
#Keep visiting for more solutions of SPOJ problems in Python 3.Thank you!!!
t=int(input())
i=0
while i<t:
n = int(input())
print ((n*(n+1)*(n+2))//2)
i+=1
#Keep visiting for more solutions of SPOJ problems in Python 3.Thank you!!!