Count numbers up to N that cannot be expressed as sum of at least two consecutive positive integers | Function to count numbers that cannot be expressed as sum of two or more consecutive + ve integers ; Stores the count of such numbers ; Driver Code
function countNum ( N ) { var ans = parseInt ( Math . log ( N ) / Math . log ( 2 ) ) + 1 ; document . write ( ans ) ; } var N = 100 ; countNum ( N ) ;