Question:
What is the sum of all integer solutions to the following equation?
(x^2−17*x+71)^(x^2−34*x+240)=1
Answer: 49
Solved using the script below resulting in 7, 8, 10 and 24 as possible integer solutions for the equation
function func1(x){
return (Math.pow(x,2)-(17*x)+71);
}
function func2(x){
return (Math.pow(x,2)-(34*x)+240);
}
console.log("**************************************");
var max=10000000;
for(var a=-max; a<=max; a++){
var temp1 = func1(a);
var temp2 = func2(a);
if(temp1==1 || temp2==0 || (temp1==-1 && temp2%2==0)){
console.log("a: "+a+" temp1: "+temp1+" temp2: "+temp2);
}
}
Please take down this post
ReplyDelete-Calvin Lin
Brilliant Mathematics Challenge Master