Maximum LCM among all pairs ( i , j ) of first N natural numbers | Java implementation of the approach ; Function to return the maximum LCM among all the pairs ( i , j ) of first n natural numbers ; Driver code
class GFG { static int maxLCM ( int n ) { return ( n * ( n - 1 ) ) ; } public static void main ( String [ ] args ) { int n = 3 ; System . out . println ( maxLCM ( n ) ) ; } }