P19108 [GeeksforGeeks] Find n th term in the series3926
普及-
题目描述

Given a series 9, 33, 73, 129... Find the n-th term of the series.
Example 1:
Input: n = 4
Output: 129
Explanation: 4th term of the
series is 129.
Example 2:
Input: n = 5
Output: 201
Explanation: 5th term of the
series is 201.
Your Task:
You dont need to read input or print anything. Complete the function nthOfSeries() which takes n as input parameter and returns n-th term of the series.
Expected Time Complexity: O(1)
Expected Auxiliary Space: O(1)
Constraints:
1<= n <=10^{4}

输入格式

见题面

输出格式

见题面

样例输入
n = 4
样例输出
129