Answer:
y = x - 8
Explanation:
There's no magic method to doing these, and problem 21 makes it harder to see a pattern by using inputs that are not consecutive integers (like problem 20 does)!
Looking at inputs 20 and 21, the outputs are 8 less than the inputs. Check the other inputs and notice that the same pattern holds up.