I am developing a Game and I didn’t want an array full of levels that would most likely increase page load when iterating through them to find the users Level. I needed an algorithm to work this out independently with only the User’s experience to hand. This is because I want the max Level to be around 1,000, and an array that long would take some time to go through.
I have, with some help, come up with the following algorithm for the difference between each level:
difference = difference + (difference / 7)
And it works well on the lower-levels, but this graph is the Levels 1-141, and as you can see, it’s extremely easy up until about half way, then it shoots up and carries on shooting up, until it gets to the point 1,500,000,000 Experience is Level ~250, which isn’t good enough.

So, my question is, what do you think is a better way to do the difference between each level? Any advice is welcome, I will test all algorithms.
Thanks.
First off, there’s the linear system.
Every 1,000 experience equates to one level. To make leveling slow down, you decrease the rate at which experience is acquired. This has the added bonus of making super-easy activities count as zero experience later, so you can’t become epic by slaying rats.
Then there are decreasing-returns curves of various sorts. For example:
With a scale of 2 (sqrt curve), for level 1, you need 1,000 experience. For two, you need four thousand. For three, nine thousand. Each level gets harder and harder. If you make the scale smaller, the rate at which the difficulty ramps up decreases (the slope gets less steep).
I suggest building the function itself, rather than building the first derivative (as you seem to have tried to do). That’ll give you a better idea about the graph before you integrate.