public static void main ( String [] args ) {
    
	double num = 600851475143.00;
	int max = 0;

	for ( int i = 2; i <= num; i++ ) {

	    if ( num % i == 0 ) {
	       	num = num / i;
		max = i;
		i--;
	    }

	}

	System.out.println("max prime factor = " + max);

    }