public static void main(String[] args) {
		long start = System.nanoTime();
		Long num = new Long("600851475143");
		long factor = 0;

		// Loop starts at the maximum possible factor and descends until a
		// number is found that is prime and also a factor
		for (Long i = (long) Math.sqrt(num) + 1; i > 0; i -= 2) {
			if (isPrime(i) && num % i == 0) {
				factor = i;
				break;
			}
		}
		System.out.println(factor);
		System.out.println("Done in " + (double) (System.nanoTime() - start)
				/ 1000000000 + " seconds.");
	}