Count numbers up to N that cannot be expressed as sum of at least two consecutive positive integers | C # program for the above approach ; 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
using System ; class GFG { static void countNum ( int N ) { int ans = ( int ) ( Math . Log ( N ) / Math . Log ( 2 ) ) + 1 ; Console . WriteLine ( ans ) ; } static void Main ( ) { int N = 100 ; countNum ( N ) ; } }