Highest power of 2 that divides the LCM of first N Natural numbers . | Java implementation of the approach ; Function to find the highest power of 2 which divides LCM of first n natural numbers ; Driver code
class GFG { static int highestPower ( int n ) { return ( int ) ( Math . log ( n ) / Math . log ( 2 ) ) ; } public static void main ( String [ ] args ) { int n = 15 ; System . out . println ( highestPower ( n ) ) ; } }