video game math, need help writing iterative function (I think)

Kevin Finnerty

New member
Joined
Feb 22, 2024
Messages
1
I'm so annoyed that I've been put in a situation where I actually need to use this math, and forgot how to do it. I made an account just to ask this question.

I'm playing the a game where, beyond a certain "level up" (level 4) of one's avatar, one gains +2 "skill points" added to whatever value they normally have to distribute based on the avatar. So, at level 4, my avatar would normally have 15 "skill points" to distribute. With this feature, at level 5, I have 17 skill points. at level 6, 19, and so on.

Unfortunately, the feature glitched after level 5, and I had not noticed until I reached level 38. So, at level 6, I had 17 instead of 19, at level 7 I had 17 instead of 21, and so on.

I would like to calculate the total skill points that I should have received, but did not, due to the glitch, minus the 17 that I would have spent anyway each time i gained a level, from level 5 to level 38. I believe this pertains to something I learned about in high school called an iterative function where you perform the same function multiple times, but I have no idea how to write one for this. Or, I could be totally wrong and this is far simpler. Either way, I'm stumped.
 
Level 6: lost 2 points
Level 7: lost 4 points
Level 8: lost 6 points
...

This is an arithmetic sequence (the difference between consecutive terms is constant). Look up the formula for the sum of such a sequence.
 
Top