Question:
If the numbers a, b, and c are multiplied as abc, and the result is 100 and if (a^(log a / log 10)) * (b^(log b / log 10)) * (c^(log c / log 10)) >= 10000, what is the sum, a + b + c?
Answer: 102
Solved using the script below which results in the only combination, 1, 1 and 100:
console.log("*******************************");
function log10(val){
return Math.log(val)/Math.LN10;
}
function aloga(x){
return Math.pow(x,log10(x));
}
var max = 200;
for(var i=1; i<=max; i++){
for(var j=1; j<=max; j++){
for(var k=1; k<=max; k++){
temp = aloga(i)*aloga(j)*aloga(k);
if(i*j*k===100 && temp>=10000){
console.log(i+" "+j+" "+k+" "+temp);
}
}
}
}
No comments:
Post a Comment