What is the sum of all possible integer values of x such that

(x^2−35x+305)^(x^2−42x+416)=1?

well, a^0 = 1

so we need x^2−42x+416=0, so x=16,26
16+26=42

Luckily, x^2−35x+305 is not zero for any integer value, so we're ok. (0^0 is undefined, not 1)