Check if a given number N has at least one odd divisor not exceeding N | Function to check whether N has at least one odd divisor not exceeding N - 1 or not ; Stores the value of N ; Reduce the given number N by dividing it by 2 ; If N is divisible by an odd divisor i ; Check if N is an odd divisor after reducing N by dividing it by 2 ; Otherwise ; Driver Code ; Function Call
def oddDivisor ( N ) : NEW_LINE INDENT X = N NEW_LINE while ( N % 2 == 0 ) : NEW_LINE INDENT N //= 2 NEW_LINE DEDENT i = 3 NEW_LINE while ( i * i <= X ) : NEW_LINE INDENT if ( N % i == 0 ) : NEW_LINE INDENT return " Yes " NEW_LINE DEDENT i += 2 NEW_LINE DEDENT if ( N != X ) : NEW_LINE INDENT return " Yes " NEW_LINE DEDENT return " No " NEW_LINE DEDENT N = 10 NEW_LINE print ( oddDivisor ( N ) ) NEW_LINE