14 lines
265 B
JavaScript
14 lines
265 B
JavaScript
var a = 591;
|
|
var b = 393;
|
|
var total = 0;
|
|
for(var i = 0; i <= 40000000; i++){
|
|
a = (a*16807)%2147483647;
|
|
b = (b*48271)%2147483647;
|
|
if(a.toString(2).slice(-16) == b.toString(2).slice(-16)){
|
|
total++;
|
|
console.log(i);
|
|
console.log(a, b);
|
|
}
|
|
}
|
|
console.log(total);
|