Explanation:
after a little bit of thinking and experimenting we find that the function multiplied x by 6 and subtracts 2.
y = 6x - 2
formally, we find this by using the normal linear form
y = ax + b
and we use the given data points to find a and b.
4 = a×1 + b = a + b
10 = a×2 + b = 2a + b
so, by adding a on one side and adding 6 on the other side, we keep the balance.
therefore, a = 6
the first equation gives us then
4 = 6 + b
b = -2
and that's it.
so,
for x = 10 we get as output (y)
6×10 - 2 = 58
for x = n we get as output (y)
6n - 2