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
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.
preparecodinginterview_dot_com | 190 |
__murugan__ | 173 |
manvimahajan20 | 140 |
xiaoyan_yunche | 139 |
ShameekAgarwal | 116 |
preparecodinginterview_dot_com | 190 |
__murugan__ | 173 |
manvimahajan20 | 166 |
SoumyaKaushik | 146 |
arpit_anshuman | 140 |
blackshadows | 5331 |
Ibrahim Nash | 5219 |
akhayrutdinov | 5111 |
mb1973 | 4929 |
Quandray | 4567 |