<commit_before>package euler.problems;

import euler.utils.NumberUtils;

import java.util.concurrent.Callable;
import java.util.function.LongSupplier;
import java.util.stream.LongStream;

import static euler.utils.NumberUtils.isDivisbleBy;
import static euler.utils.NumberUtils.isOdd;
import static euler.utils.NumberUtils.isPrime;

/**
 * The prime factors of 13195 are 5, 7, 13 and 29.
 *
 * What is the largest prime factor of the number 600851475143 ?
 *
 * @author james.bogan
 */
public class Problem3 implements Callable<Long> {
    private static final long NUMBER_TO_TEST = 600_851_475_143L;

    @Override
    public Long call() throws Exception {
        return LongStream
                .range(1, Math.round(Math.sqrt(NUMBER_TO_TEST)))
                .filter(x -> isDivisbleBy(NUMBER_TO_TEST, x) && isPrime(x))
                .sorted()
                .max()
                .getAsLong();
    }
}<commit_msg>Removed unnecessary sorted call<commit_after>package euler.problems;

import euler.utils.NumberUtils;

import java.util.concurrent.Callable;
import java.util.function.LongSupplier;
import java.util.stream.LongStream;

import static euler.utils.NumberUtils.isDivisbleBy;
import static euler.utils.NumberUtils.isOdd;
import static euler.utils.NumberUtils.isPrime;

/**
 * The prime factors of 13195 are 5, 7, 13 and 29.
 *
 * What is the largest prime factor of the number 600851475143 ?
 *
 * @author james.bogan
 */
public class Problem3 implements Callable<Long> {
    private static final long NUMBER_TO_TEST = 600_851_475_143L;

    @Override
    public Long call() throws Exception {
        return LongStream
                .range(1, Math.round(Math.sqrt(NUMBER_TO_TEST)))
                .filter(x -> isDivisbleBy(NUMBER_TO_TEST, x) && isPrime(x))
                .max()
                .getAsLong();
    }
}
{'fraction_non_alphanumeric': 0.09738846572361262, 'fraction_numerical': 0.04026115342763874, 'mean_word_length': 3.0866666666666664, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1664579', 'n_tokens_mistral': 638, 'n_tokens_neox': 563, 'n_words': 142}