TRICOUNT  Counting Triangles
We define the LEVEL of a triangle as in the following illustrative image:
Task: Your task is very easy. All you have to do is to count all triangles in the biggest one (Level N).
Input
The first line of the input contains an integer T (T ≤ 10000)  the number of test cases and T lines follow. Each line contains an integer N (1 ≤ N ≤ 10^{6}) which is the level of the triangle in that test case.
Output
For each test case, you should write a seperate line: the number of triangles in the biggest one (Level N). (All answers will fit within the range of a 64bit integer)
Example
Input:
3
1
2
3
Output:
1
5
13
Source limit is 500 bytes.
hide comments
Gaurav Jain:
20150615 14:16:39
My solution http://ideone.com/XC1fwx is showing runtime error. Can anyone help me to detect it? 

r0bo_dart:
20150612 20:10:57
lame question... formula oriented.. using recursion fails for N > 10^5


Rishabh Joshi:
20150530 14:02:21
using pow() caused WA. 

Babloo:
20150528 08:46:21
http://www.transum.org/Software/SW/Starter_of_the_day/starter_September23.asp may be useful


kobe24:
20150527 00:26:59
http://jwilson.coe.uga.edu/emt725/Bob/Count.Triangles.II.html


Anton Chigurh:
20150523 20:33:42
Because of the source code limitation, I literally had to minify my Java code the same way JavaScript files are minified. 

scyth3r:
20150507 00:18:45
"telescoping series" made calculations easy...... 

Phong:
20150421 15:45:07
@Singh  Thank you I got it :D 

hareesh:
20150421 08:47:37
Test Cases (Use them to get the pattern)


Dushyant Singh:
20150418 22:10:48
@Phong  We add layers of triangles level by level. In level 1, we have 1 triangle. In level 2, we add second layer of triangles below first layer such that a big triangle is formed. Same thing is for other levels. So for level 3, we add third layer of triangles below second level. 
Added by:  nha.duong 
Date:  20070805 
Time limit:  1s 
Source limit:  500B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 ERL JSRHINO NODEJS OBJC PERL6 SQLITE VB.NET 
Resource:  Trần Huy Hưng 