#C11972. The Mysterious Sequence
The Mysterious Sequence
The Mysterious Sequence
We define a mysterious sequence as follows: the first element is 1, and for every integer n > 1, the n-th element is equal to the sum of all the previous elements plus 1. In mathematical terms,
\(a(1)=1\) and for \(n>1\), \(a(n)=\left(\sum_{i=1}^{n-1}a(i)\right)+1\).
It can be proven that this recurrence is equivalent to the closed form formula: \(a(n)=2^{n-1}\).
Your task is to compute the n-th element of this sequence for a number of test cases.
inputFormat
The input is given via standard input (stdin). It begins with a single integer T (T > 0) on the first line, representing the number of test cases. The following T lines each contain one integer n. For each test case, you are to compute the n-th element of the mysterious sequence.
outputFormat
For each test case, output the corresponding n-th element on a separate line via standard output (stdout).
## sample3
1
2
4
1
2
8
</p>