Gtfuc,
<!DOCTYPE html>
<html>
<head>
<title>title</title>
</head>
<body> <p></p>
<script>
function www() { //поиск всех 5-значных простых чисел
var p = 100000,j = 10000,
h = [];
for (; j <= p; j++) {
var k = 0, n = Math.sqrt(j);
for (var i = 2; i <= n; i++)
if (j % i == 0) k = k + 1;
k || h.push(j)
}
return h
};
function palindrome(num) {
var tmp = num, res = 0, dig;
while (tmp) {
dig = tmp % 10;
res = res * 10 + dig;
tmp = (tmp - dig) / 10;
}
return res == num;
}
console.time("t")
var arr = www(),
a = {r:0};
for (var i=0; i<arr.length; i++) {
for (var j=i; j<arr.length; j++) {
var n = arr[i] * arr[j];
if(n < a.r) continue;
if(palindrome(n)) {a.r = n; a.a = arr[i];a.b = arr[j] }
}
}
console.timeEnd("t")
document.querySelector("p").innerHTML = JSON.stringify(a);
</script>
</body>
</html>