1 + 4 = 5
2 + 5 + 5 = 12
3 + 6 + 12 = 21
8 + 11 + 21 = 40
So the missing number is 40 and that we can see from the above deduction. Actually the number that we get from the previous addition is added with the next addition to get the result. This is the link between the equations.