Explanation
This looks like an arithmetic sequence problem.
If the first term a = 3 a = 3 and last term l = 18 l = 18 , and there are 4 numbers in between , the total terms n = 6 (3 + 4 + 18). The terms:
a 1 = 3 a_1 = 3
a 6 = 18 a_6 = 18
Number of terms n = 6 n = 6 n = 6 Common difference d = 18 − 3 6 − 1 = 15 5 = 3 d = frac{18 - 3}{6 - 1} = frac{15}{5} = 3 d
The 3rd middle number is the 4th term :
a 4 = a 1 + 3 d = 3 + 3 × 3 = 12