Let $f(x)=3x+2$ and $g(x)=ax+b$, for some constants $a$ and $b$. If $ab=20$ and $f(g(x))=g(f(x))$ for $x=0,1,2\ldots 9$, find the sum of all possible values of $a$.
Soluiton by computer program:
f(x) = 3x + 2
g(x) = ax + b
for (1 <= a <= 20)
for (1 <= b <= 20)
if (a*b == 20)
if (f(g(x)) = g(f(x)) for 0 <= x <= 9) output(a)
output = 2, 3, 4, 5
Sum of all possible a = 2 + 3 + 4 + 5 = 14.
sorry, I tried that answer and it is incorrect.