100-sided dice roll problem When should I stop rolling if it costs $1 for each roll and I earn only the value of the final roll shown on a 100-sided dice roll? My intent is to maximise profit and I have unlimited rolls

Here is a function to compute the expected best profit of the game recursively, in Python. This value is 86.35, and it is also the case that for all values of last_roll greater than or equal to 87, the most profitable option is to stop playing right away (best_profit(last_roll, rolls) == last_roll - rolls). I do not know how to prove that mathematically, however. For values strictly less than 87 there exist both situations where continuing is more profitable, and situations where stopping is more profitable.
#!/usr/bin/env python3

from functools import cache

@cache
def best_profit(last_roll, rolls):
    # If the maximal possible profit in the next roll is less than or equal to zero, there is no profit in playing at all, stop immediately.
    if 100 - (rolls + 1) <= 0:
        return last_roll - rolls
    # If the profit of stopping is greater than or equal to the maximal possible profit of continuing, stop.
    if last_roll - rolls >= 100 - (rolls + 1):
        return last_roll - rolls

    return max(last_roll - rolls, 0.01 * sum(best_profit(next_roll, rolls + 1) for next_roll in range(1, 100+1)))

print(best_profit(0, 0))

