Crack the series
Submissions: 3475   Accuracy:

17.21%

  Difficulty: Easy   Marks: 2

Given the series as follows 2 2 4 8 16 512....... Identify the nth term of the series. Answers can be very large use BigInt in Java.
Input:
First line consists of Q queries. Each of the next Q lines contain a number N which represents the Nth term of the series.
Output:
Output the Nth term of the series.
Constraints:
1<=Q<=50
1<=N<=12
Example:
Input:

2
4
7
Output:
8
256

** For More Input/Output Examples Use 'Expected Output' option **

Author: Ayush Saluja


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.