I am having trouble with the following math problem. There is a variable "xp" that starts at 0. At xp of 0, the level is 1. At xp 500, the level is 2; at xp 1250 the level is 3; at xp 2250 the level is 4, and so on. 0 xp (lvl1) + 500 xp (lvl2) + 750 xp (lvl3) + 1000 xp (lvl4) + 1250 xp (lvl5) + 1500 xp (lvl6) etc...
So that means for level 6, you would need: 5000 xp. Each level adds the total amount of the previous level + 250. So level 3 is 500 (from level 2) plus (500+250), which makes 1250.
Therefore, what is the formula to determine the level for any xp value? And vice versa, how do we determine the xp for a certain level?