Geek and his Tricky Series
Submissions: 5464   Accuracy:

26.62%

  Difficulty: Easy   Marks: 2

Given a series with starting 6 members of the series. Given an integer n find the nth term of this series.

Series: 7, 15, 32, 67, 138, 281, ............

Examples :

Input : 7
Output : 568

Input:
First line of the input contains an integer T, denoting the number of test cases. Then T test case follows. The only line of the test case contains an integer N.

Output:
For each test case print the nth term of the series in a new line.Print the answer modulo 10^9 +7.

Constraints:
1<=T<=100

1<=N<=120

Example:
Input:

2
9
16
Output:
2294
294895

 

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

Author: harshitsidhwa


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

to report an issue on this page.