Two problems with the analysis:
- Rather than “XP(20)-XP(n)” it should be the effort to go from level n to level n, which is related but not identical to the XP needed, because of 10% XP cap.
For most people the best way to level after level 10 would be in gland (reaching the 10% cap until level 17 or 18) the effort needed is closer to linear than quadratic (in terms of 20-n).
- I need to think more but I believe you missed an important consideration here. This formula assumes that you either level from n to 20, or start over entirely. But you can also e.g. level from n to n+1 and restart if the roll at level n+1 is too bad.
To do it correctly I think you have to set up a recurrence for all possible percentiles at different levels. Assuming the effort needed is modeled as a linear or quadratic function, I suspect there is still a “simple” formula because it’s just a linear or quadratic combination of binomial coefficients. But I’m not too sure off the top of my head.