Highest power of 2 that divides the LCM of first N Natural numbers . | Python3 implementation of the approach ; Function to find the highest power of 2 which divides LCM of first n natural numbers ; Driver code
import math NEW_LINE def highestPower ( n ) : NEW_LINE INDENT return int ( ( math . log ( n ) // math . log ( 2 ) ) ) ; NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT n = 15 ; NEW_LINE print ( highestPower ( n ) ) ; NEW_LINE DEDENT