Using sequence differences, you have this:
5, 7, 12, 20, 31
2, 5, 8, 11
3, 3, 3
From the above, we can formulate a "closed form" as follows:
a_n = 1/2 (3 n^2 - 5 n + 12), which will give you each term in your sequence as follows:
5, 7, 12, 20, 31, 45, 62, 82, 105, 131, 160, 192, 227, 265, 306, 350, 397, 447, 500, ....etc.