Positive integers have so many gorgeous features.
Some of them could be expressed as a sum of two or more consecutive positive numbers.
10
, could be expressed as a sum of1 + 2 + 3 + 4
.
Given Positive integer, N , Return true if it could be expressed as a sum of two or more consecutive positive numbers , OtherWise return false .
- Guaranteed constraint : 2 ≤ N ≤ (2^31) -1 .
* consecutiveDucks(9) ==> return (true) // 9 , could be expressed as a sum of ( 2 + 3 + 4 ) or ( 4 + 5 ) .
* consecutiveDucks(64) ==> return (false)
* consecutiveDucks(42) ==> return (true) // 42 , could be expressed as a sum of ( 9 + 10 + 11 + 12 ) .