We have the points of a linear function and need to find the equation that represent.
Because it is a linear function, we can find its equation with two points.
We get the points (1,3) and (2,1):
We can check that the points (3,-1) and (4,-3) also satisfy the equation that we found above:
The above shows that the points satisfy the equation.
So, for input=n the output is: