BETA

Difficulty Level: Basic

Total Submissions: 1225 Accuracy:

6.69%

Pell Number
     

Pell numbers are numbers that are similar to the Fibonacci numbers and are generated by below formula
Pn = 2*Pn-1 + Pn-2
with seeds P0 = 0 and P1 = 1
Your task is to print Nth pell number.

Input:
First line consists of T test cases. Only line of every test case consists of N.

Output:
Single line output, print the Nth pell number.

Constraints:
1<=T<=100
1<=N<=100

Example:
Input:

1
4
Output:
12

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

Contributor: Saksham Raj Seth

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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