The equation is graphed here: https://www.desmos.com/calculator/kgvnud77dg
I've come up with this equation as part of designing a game. This equation is used to map the user level to their cumulative score. In the game, I only store the user cumulative score. So, I need the inverse function to calculate the level on the fly by simply passing the score.
Example of corresponding Levels and Scores:
Level 1: $ f(1) = 0 $
Level 2: $ f(2) = 260 $
Level 3: $ f(3) = 627 $
Level 4: $ f(4) = 1066 $
Level 5: $ f(5) = 1561 $
Level 10: $ f(10) = 4694 $
Level 50: $ f(50) = 53312 $
Level 100: $f(100) = 160330 $
Level 200: $f(200) = 548423 $
I need to be able to calculate the level using score, like this: $ f^{-1}(1561) = 5 $
In this particular case, your best bet is not to use the inverse function (whose closed form, if it exists, is probably a horrible mess), but to sample this function at every possible level value that you want (let's hope that you don't want infinite levels) and then when you're given a score, check the index of the score that's immediately lower than it. This works because your function is strictly increasing. In pseudo-code it would look like this :