TERMN  Nth Term
Find the nth term of the sequence 1, 4, 16, 36, 100, ...
Input
First Line : T (No. of test cases < 1000)
T Lines each containing a value of n (n < 100000)
Output
Exactly T lines each containing nth term of the sequence.
Example
Input: 4
2
3
4
5
Output: 4
16
36
100
hide comments
barishnamazov:
20171025 21:48:13
Hmm, got AC finally...


aditya_rev:
20160909 20:30:24
Difficult problem that need big numbers in c :( 

VilimL:
20160118 09:34:33
How can it be done in C? What is the modulo? 

kiner_shah:
20151003 19:02:08
Please correct me if my sequence is wrong!


REX:
20150426 08:01:01
I did it in C 

REX:
20150426 08:00:00
I got the series and my source code is only 19 lines long....still showing memory error, my code works fast till n=1000000 and yet memory error, memory limit of 300B is too much 

Hector Monteo:
20140126 04:50:59
for n = 6


Mitch Schwartz:
20140103 19:32:56
@Pranjal Successena: Your comment is unfortunately nonsense. Actually for these types of problems there are an infinite number of valid sequences with a "simple" formula when given the first n terms, for n arbitrary large. Just look up interpolating polynomial. And that's why it is in riddle section. There are a handful of somewhat similar problems that I consider "grandfathered in" and have been allowed to stay in classical or challenge (with some discussion): SUMUP, EASYPROB, EPROBLEM, HARDP, and maybe more that I don't know about or can't think of at the moment.


Pranjal Successena:
20140103 15:29:15
this is an incomplete problem...


narek:
20131110 15:27:23
Can I have a big test case

Added by:  Mukund Kumar 
Date:  20130830 
Time limit:  0.100s 
Source limit:  300B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  C CSHARP C++ 4.3.2 CPP C99 JAVA PYTHON PYTHON3 PY_NBC 
Resource:  Self 