A Carol number is an integer of the form 4^{n} – 2^{(n+1)} – 1. Given a number N, the task is to find the N’th Carol Number. First few carol numbers are -1, 7, 47, 223, 959… etc. 
 
Example 1:
Input:
N = 2
Output:
7
Explanation:
2^{nd} Carol Number is 7
Example 2:
Input:
N = 4
Output:
223
Explanation:
4^{th }Carol Number is 223
 
Your Task:
You don't need to read input or print anything. Your task is to complete the function nthCarol() which takes an Integer N as input and returns the answer.
 
Expected Time Complexity: O(1)
Expected Auxiliary Space: O(1)
 
Constraints:
1 <= N <=^{ }15

Source: geeksforgeeks | Difficulty: EASY
Tags: Mathematics

Starter code: #User function Template for python3

class Solution:
    def nthCarol(self, N):
        # code here 

Solutions:
class Solution:

	def nthCarol(self, N):
		return int(4 ** N - 2 ** (N + 1) - 1)


import math

class Solution:

	def nthCarol(self, N):
		return 4 ** N - 2 ** (N + 1) - 1


class Solution:

	def nthCarol(self, N):
		a = 4 ** N - 2 ** (N + 1) - 1
		return a


class Solution:

	def nthCarol(self, N):
		ans = 4 ** N - 2 ** (N + 1) - 1
		return ans


class Solution:

	def nthCarol(self, N):
		return pow(4, N) - pow(2, N + 1) - 1


class Solution:

	def nthCarol(self, N):
		x = []
		for i in range(1, N + 1):
			x.append(4 ** i - 2 ** (i + 1) - 1)
		return x[N - 1]


class Solution:

	def nthCarol(self, N):
		n = N
		carol = 4 ** n - 2 ** (n + 1) - 1
		return carol


class Solution:

	def nthCarol(self, N):
		return (2 ** N - 1) ** 2 - 2


class Solution:

	def nthCarol(self, N):
		return 4 ** N - 2 ** (N + 1) - 1
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		N = int(input())
		ob = Solution()
		print(ob.nthCarol(N))


class Solution:

	def nthCarol(self, N):
		l = 4 ** N - 2 ** (N + 1)
		return l - 1


class Solution:

	def nthCarol(self, N):
		a = pow(4, N)
		b = pow(2, N + 1)
		d = a - b - 1
		return d


import math

class Solution:

	def nthCarol(self, n):
		return pow(4, n) - pow(2, n + 1) - 1


import math

class Solution:

	def nthCarol(self, N):
		if N > 1:
			x = int(pow(4, N) - pow(2, N + 1)) - 1
			return x
		else:
			return -1


class Solution:

	def nthCarol(self, n):
		k = 4 ** n
		b = 2 ** (n + 1)
		return int(k - b - 1)


class Solution:

	def nthCarol(self, N):
		result = 4 ** N - 2 ** (N + 1) - 1
		return result


class Solution:

	def nthCarol(self, N):
		val = 4 ** N - 2 ** (N + 1) - 1
		return val


class Solution:

	def nthCarol(self, N):
		res = 4 ** N - 2 ** (N + 1) - 1
		return res