Given a number n, the task is to check whether it can be expressed as a sum of two or more consecutive numbers or not.
Input : n = 10 Output : 1 It can be expressed as sum of two consecutive numbers 1 + 2 + 3 + 4. Input : n = 16 Output : 0 It cannot be expressed as sum of two consecutive numbers. Input : n = 5 Output : 1 2 + 3 = 5
The first line contains 'T' denoting the number of test cases. Then follows description of test cases.
Each test case contains a single positive integer n.
Print "1" if number can be expressed as sum of consecutives else "0". (Without the double quotes)
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.