There's a linear relationship because the outputs are separated by 5.
y=ax+b represents the relationship. Plug in x=1 and y=2:
2=a+b then plug in x=2 and y=7:
7=2a+b. Subtract the two equations: 5=a, so a=5 and 2=a+b so b=2-5=-3
Therefore y(output)=5x(input)-3.
Test the formula y=5x-3 for the other inputs:
x=3: y=12; x=4, y=17; x=5, y=22. They all fit.