A linear function is something like
. The coefficient m is the slope of the function, i.e. the coefficient that scales an increase of the x value to an increase of the y value.
From the values we're given, we can that everytime the x values increase by 1 (
), the y value increase by 4 (
). This means that the coefficient m is "magnifying" the increases by 4, so our equation is something like
.
To find the value of q, we only need to plug a known couple and solve the equation, if we choose the first point (1,6), we have

So, the equation is

So, if the input is a generic number n, the output will be