<commit_before><!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Language" Content="en" />
<meta charset="utf-8">

<style>
    p{
        word-break:break-all;
    }
</style>

</head>
<body>
<p id='result'></p>

<script>
  
//判断是否为质数
function isPrime(n) {
    for (var i = 2; i < n; i++) {
        if (n % i == 0) {
            return false;
        }
    }
    return true;
}

//获取 n 以内的 质数
function getPrimes(n){
    var arr = [];
    for(var i =2;i<n+1;i++){
        if(isPrime(i)){
            arr.push(i);
        }
    }
    return arr;
}

//用数组 模拟 乘法
function arrayMultiplyNum(array,num){
    var resultArray = [];
   
    var jinwei=0;
    var singleRes;
    for(var i = array.length-1; i>-1;i--){
        singleRes = (array[i]*num+jinwei);
        resultArray.unshift(singleRes%10);
        jinwei = Math.floor(singleRes/10);
    }

    //剩余进位 unshift 到数组中
    while(jinwei!=0){
        resultArray.unshift(jinwei%10);
        jinwei=Math.floor(jinwei/10);
    }
    return resultArray;
}


//统计一个元素在数组中出现的次数
function timesInArray(array,num){
    var times = 0; var index;
   while((index = array.indexOf(num))>-1){
        times++;
        array.splice(index,1);
   }
   return times;
}


var primes10k = getPrimes(10000);

var result = [1];
for(var i = 0; i<primes10k.length;i++){
    result = arrayMultiplyNum(result,primes10k[i]);
}
console.log('乘积结果:',result.join(''));


var x = document.createElement("P");
var t = document.createTextNode(result.join(''));
x.appendChild(t);
document.body.appendChild(x);



console.log('10000以内质数乘积的位数:',result.length);

console.log('0出现的次数:',timesInArray(result,0));
console.log('1出现的次数:',timesInArray(result,1));
console.log('2出现的次数:',timesInArray(result,2));
console.log('3出现的次数:',timesInArray(result,3));
console.log('4出现的次数:',timesInArray(result,4));
console.log('5出现的次数:',timesInArray(result,5));
console.log('6出现的次数:',timesInArray(result,6));
console.log('7出现的次数:',timesInArray(result,7));
console.log('8出现的次数:',timesInArray(result,8));
console.log('9出现的次数:',timesInArray(result,9));



 

</script>



</body>
</html>
<commit_msg>prime<commit_after><!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Language" Content="en" />
<meta charset="utf-8">

<style>
    p{
        word-break:break-all;
    }
</style>

</head>
<body>

<h3>10000以内的所有质数相乘:</h3>


<script>
  
//判断是否为质数
function isPrime(n) {
    for (var i = 2; i < n; i++) {
        if (n % i == 0) {
            return false;
        }
    }
    return true;
}

//获取 n 以内的 质数
function getPrimes(n){
    var arr = [];
    for(var i =2;i<n+1;i++){
        if(isPrime(i)){
            arr.push(i);
        }
    }
    return arr;
}

//用数组 模拟 乘法
function arrayMultiplyNum(array,num){
    var resultArray = [];
   
    var jinwei=0;
    var singleRes;
    for(var i = array.length-1; i>-1;i--){
        singleRes = (array[i]*num+jinwei);
        resultArray.unshift(singleRes%10);
        jinwei = Math.floor(singleRes/10);
    }

    //剩余进位 unshift 到数组中
    while(jinwei!=0){
        resultArray.unshift(jinwei%10);
        jinwei=Math.floor(jinwei/10);
    }
    return resultArray;
}


//统计一个元素在数组中出现的次数
function timesInArray(array,num){
    var times = 0; var index;
   while((index = array.indexOf(num))>-1){
        times++;
        array.splice(index,1);
   }
   return times;
}


var primes10k = getPrimes(10000);

var result = [1];
for(var i = 0; i<primes10k.length;i++){
    result = arrayMultiplyNum(result,primes10k[i]);
}
console.log('乘积结果:',result.join(''));


var x = document.createElement("P");
var t = document.createTextNode(result.join(''));
x.appendChild(t);
document.body.appendChild(x);



console.log('10000以内质数乘积的位数:',result.length);

console.log('0出现的次数:',timesInArray(result,0));
console.log('1出现的次数:',timesInArray(result,1));
console.log('2出现的次数:',timesInArray(result,2));
console.log('3出现的次数:',timesInArray(result,3));
console.log('4出现的次数:',timesInArray(result,4));
console.log('5出现的次数:',timesInArray(result,5));
console.log('6出现的次数:',timesInArray(result,6));
console.log('7出现的次数:',timesInArray(result,7));
console.log('8出现的次数:',timesInArray(result,8));
console.log('9出现的次数:',timesInArray(result,9));



 

</script>



</body>
</html>

{'fraction_non_alphanumeric': 0.19040801717967074, 'fraction_numerical': 0.02934860415175376, 'mean_word_length': 3.4882226980728053, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 37, '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': '2925948', 'n_tokens_mistral': 1810, 'n_tokens_neox': 1744, 'n_words': 255}