<commit_before>//The prime factors of 13195 are 5, 7, 13 and 29.
//What is the largest prime factor of the number 600851475143?

var theNum = 600851475143;
var factorsArr = [];

function smallestFactor(num){
	if(num%2 == 0){
		return 2
	}
	var end = Math.floor(Math.sqrt(num));
	for (var i = 3; i <= end; i += 2) {
		if(num % i == 0){
			return i;
		}
	}
	return num;
}

while(theNum != 1){
	var factor = smallestFactor(theNum);
	factorsArr.push(factor);
	theNum = theNum / factor;
}

var largestPrime = Math.max.apply(Math, factorsArr)

document.write("<br><br>The largest prime factor = " + largestPrime);<commit_msg>Update PE-Q3.js<commit_after>//The prime factors of 13195 are 5, 7, 13 and 29.
//What is the largest prime factor of the number 600851475143?

var theNum = 600851475143;
var factorsArr = [];

function smallestFactor(num){
	if(num%2 == 0){
		return 2
	}
	var end = Math.floor(Math.sqrt(num));
	for (var i = 3; i <= end; i += 2) {
		if(num % i == 0){
			return i;
		}
	}
	return num;
}

while(theNum != 1){
	var factor = smallestFactor(theNum);
	factorsArr.push(factor);
	theNum = theNum / factor;
}

var largestPrime = Math.max.apply(Math, factorsArr);

document.write("<br><br>The largest prime factor = " + largestPrime);
{'fraction_non_alphanumeric': 0.14907332796132153, 'fraction_numerical': 0.0684931506849315, 'mean_word_length': 3.8515625, 'pattern_counts': {'":': 0, '<': 9, '<?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': '6447733', 'n_tokens_mistral': 533, 'n_tokens_neox': 452, 'n_words': 136}