Let f(x)=cos(pi*x/3)

g(x)=1^x+(−1)^x
h(x)=f(x)⋅g(x)
where x is a positive integer.

Given that h(x) has a range of exactly 3 different values: a, b and c,
what is the value of a^2+b^2+c^2?

when x is odd, g(x) = 0

when x is even,
g(x) = 2
f(x) = ±1/2

so, the range of h(x) is {-1,0,1}
...