P21013 [GeeksforGeeks] Geek and his tricky series2207
普及-
题目描述

Given a series with starting 6 members of the series. Given an integer n find the nth term of this series modulo 10^{9}+7.
Series: 7, 15, 32, 67, 138, 281, ............
Example 1:
Input: n = 2
Output: 15
Explaination: The value is given in
the series in question.
Your Task:
You do not need to read input or print anything.Your task is to complete the function nthTerm() which takes n as input parameter and returns the value of the nth term modulo 10^{9}+7.
Expected Time Complexity: O(n)
Expected Auxiliary Space: O(1)
Constraints:
1 ≤ n ≤ 120

输入格式

见题面

输出格式

见题面

样例输入
n = 2
样例输出
15