y= kx+b, k-slope, b-intercept
so
2=k*1+b
7=k*2+b
12=k*3+b
17=k*4+b
solve these two equation:
2=k*1+b
7=k*2+b
second minus first is 7-2=2k-k+b-b
5=k,
so we know k=5
put this in any equation 2=5*1+b
b=2-5
b=-3
check this in
12=5*3-3 - right
17=5*4-3 - right
Answer: y=5x-3