selection-of-cities-2

James has decided to take a break from his work. He makes a plan to visit India for a few days with his family. He knows a lot about India, and also about the various cities he could visit. He decides to write down all the cities on a paper. Let the number of cities be n. Now, he shows the list to his wife and asks her, the city/cities she wants to visit. He tells her that she can select any city/cities and any number of cities. The wife says, she needs a day to decide.
After this, James calls his son and tells him all about the trip, and the list of cities. He gives him a task and asks him, the number of ways the city/cities can be chosen from the list, if the total number of cities written on the list is n. The cities are numbered from 1 to n. At least 1 city has to be selected.
He now asks your help to find the answer for the question that was asked to him. 
The problem consists of a number of test cases.
INPUT:
The first line of input contains the number of test cases t.
Then t lines follow, each contains a number n, the number of cities.
OUTPUT:
Output contains t lines; each line contains the answer for that test case. As the answer can be large, print the answer modulo 10^9+7
CONSTRAINTS
1 ≤ t ≤ 100000
1 ≤ n ≤ 10^12

Author/Problem Setter: Prateek Kumar
Tester: 

SAMPLE INPUT
2
2
1

SAMPLE OUTPUT
3
1

Explanation

For test case 1:
The only ways to select the cities is 
1
2
1 2 
Therefore the answer is 3.

For test case 2:
The only way to select a city is
1
Therefore the answer is 1.

Source: hackerearth | Difficulty: EASY
Tags: Combinatorics

Mathematics


Solutions:
t = int(input())
if(t>=1 and t<=100000):
	i=0
	while(i<t):
		n = int(input())
		if(n>=1 and i<=1000000000000):
			print((pow(2,n,1000000007)-1))
		i = i+1	


def cal(n):
	res=1
	base=2

	while n > 0:
		if n%2 == 1 :
			res=(res*base)%1000000007
		base=(base*base)%1000000007

		n=int(n/2)
	return res


def main():
	t=int(input())
	while t>0:
		n=int(input())
		print(cal(n)-1)
		t=t-1


main()


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'


MOD= 1000000007
def ipow(base,exp):
	res=1
	while(exp):
		if(exp&1):
			res=(res*base)%MOD
		exp=exp>>1
		base=(base*base)%MOD
	return res
	
	

t=eval(input())
for k in range (1,t+1):
	j=eval(input())
	po=ipow(2,j)
	print(po-1)


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
for i in range(eval(input())):
	a=eval(input())
	print(pow(2,a,1000000007)-1)


t=eval(input())
while t>0:
	n = eval(input());
	print(pow(2,n,1000000007)-1)
	t-=1


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
test = eval(input())
while test:
	test-=1
	num=eval(input()) #taking nput
	print(((pow(2,num,1000000007)-1)+1000000007)%1000000007) #answer


mod = 10**9+7
def square(x,y):
	if y==0:
		return 1
	res = square(x,y/2)
	res*=res
	if y%2==0:
		return res%mod
	else:
		return (x*res)%mod


test = int(input())
for i in range(test):
	n = int(input())
	result = (square(2,n) - 1)
	print(result)


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'


MOD= 1000000007
def ipow(base,exp):
	res=1
	while(exp):
		if(exp&1):
			res=(res*base)%MOD
		exp=exp>>1
		base=(base*base)%MOD
	return res
	
	

t=eval(input())
for k in range (1,t+1):
	j=eval(input())
	po=ipow(2,j)
	print(po-1)


T=int(input().rstrip())
while T > 0:
	N=int(input().rstrip())
	p=1
	a=2
	while N > 0:
		if N%2 != 0:
			p=(p*a)%1000000007
		a=(a*a)%1000000007
		N=N/2
	print(p-1)
	T=T-1


t=eval(input())
mod=1000000007
while t:
	t-=1
	n=eval(input())
	print((pow(2,n,mod)-1+mod)%mod)


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'


MOD= 1000000007
def ipow(base,exp):
	res=1
	while(exp):
		if(exp&1):
			res=(res*base)%MOD
		exp=exp>>1
		base=(base*base)%MOD
	return res
	
	

t=eval(input())
for k in range (1,t+1):
	j=eval(input())
	po=ipow(2,j)
	print(po-1)


test_cases = int(input())

num_of_cities = []
for test_case in range(test_cases):
	num_of_cities = int(input())
	print(pow(2,num_of_cities,pow(10,9)+7)-1)



def powermod4(a, b, n):
	if b == 1:
		return a % n
	r = powermod4(a, b / 2, n)
	r = r * r % n
	if (b & 1) == 1:
		r = r * a % n
	return r%mod

mod =10**9+7
for _ in range(eval(input())):
   a= eval(input())

   print(powermod4(2,a,mod)-1)