Find N-th term in the series
Basic Accuracy: 74.77% Submissions: 6694 Points: 1

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 <=104

We are replacing the old Disqus forum with the new Discussions section given below.
Click here to view old Disqus comments.


to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Find N-th term in the series

Output Window