Given a series of numbers 2, 10, 30, 68, 130.., Identify the pattern in the series. You are given an integer X you need to find out the X'th number in the series.
Example 1:
Input:
X = 1
Output:
2
Explanation:
2 is the first number in the series.
Example 2:
Input:
X = 2
Output:
10
Explanation:
10 is the second number in the series.
Your Task:  
You don't need to read input or print anything. Your task is to complete the function X1Series() which takes an integer X as an input parameter and return the X'th number in the series.
Expected Time Complexity: O(1)
Expected Auxiliary Space: O(1)
Constraints:
1 ≤ X ≤ 10^{5}

Source: geeksforgeeks | Difficulty: EASY
Tags: Mathematics

Starter code: #User function Template for python3

class Solution:

	def X1Series(self, X):

		# code here

Solutions:
class Solution:

	def X1Series(self, X):
		return pow(X, 3) + X


class Solution:

	def X1Series(self, m):
		return m * (m * m + 1)


class Solution:

	def X1Series(self, X):
		temp = 2
		xr = 3
		sums = 0
		if X == 1:
			return temp
		for i in range(2, X + 1):
			temp = temp + xr
			xr = xr + 2
			sums = temp * i
		return sums


class Solution:

	def X1Series(self, X):
		return X * (X * X + 1)


class Solution:

	def X1Series(self, n):
		return n ** 3 + n


class Solution:

	def X1Series(self, x):
		return x ** 3 + x


class Solution:

	def X1Series(self, X: int) -> int:
		return X + X ** 3


class Solution:

	def X1Series(self, x):
		return x * (x * x + 1)


class Solution:

	def X1Series(self, n):
		return 2 + 2 * (n - 1) + 3 * ((n - 1) * n) // 2 + (n - 1) * n * (2 * n - 1) // 2
if __name__ == '__main__':
	T = int(input())
	for i in range(T):
		X = int(input())
		ob = Solution()
		ans = ob.X1Series(X)
		print(ans)


import math

class Solution:

	def X1Series(self, X):
		return int(math.pow(X, 3)) + X


class Solution:

	def X1Series(self, X):
		n = X - 1
		return n * (n * n + 3 * n + 4) + 2


class Solution:

	def X1Series(self, X):
		n = 0
		n = X ** 3 + X
		return n


class Solution:

	def X1Series(self, X):
		nth_term = X * (X ** 2 + 1)
		return nth_term