Woodall Number
Submissions: 851   Accuracy:

44%

  Difficulty: Easy   Marks: 2

Given a number X. The task is to check if X is woodall number or not.
A Woodall Number is of the form:

Wn = n.2n – 1

The first few Woodall numbers are: 1, 7, 23, 63, 159, 383, 895……
 

Input:
The first line of the input contains an integer T denoting number of test cases. Each of the following T lines will contain an integer N.

Output:

For each test case, Print 1 if N is a Woodall number else 0 in a new line.

Constraints:
1<=T<=10^4
1<=N<=10^5

Example:

Input
2
383
200

Output:
1
0

 

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

Author: ShivamKD


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.