Mysterious Series
Submissions: 1688   Accuracy:

19.64%

  Difficulty: Easy   Marks: 2

Ishaan is an adventurous guy. Today while wandering in a forest he found a cave. Bravely enough he enters the cave and finds some numbers carved on the walls of the cave which seemed to form a mysterious series.
But some of the numbers were missing. Now, Ishaan wants to complete the series. Help him find the Nth term of the series.
N    Nth term
1    5
2    10
3    26
4    50
5    122
.
.
.
10    842

Input : 
First line of input contains a single integer T denoting the number of test cases.
The only line of each test case contains an integer N.

Output : 
For each test case, print the Nth term of the series.

Constraints : 
1 <= T <= 500
1 <= N <= 5000

Example : 
Input : 

6
1
2
3
4
5
10
Output : 
5
10
26
50
122
842

** For More Input/Output Examples Use 'Expected Output' option **

Author: goyalanubhav11


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.