Same puzzle at Expected value of game involving 100-sided die and Let's play a dice game
If the dice shows at least $x+1$ we take take that results else for the dice game; when dice shows x or less we re-throw dice and take a penalty $(x-c)$ where $c=1$ which occurs with probability $x/100,$ so our expectation x is
$$E[X] = E[X|X > x] + x/100 \cdot (E[X] - c)$$
$$x = 1/100 \cdot \sum^{100}_{k=x+1} k + x/100 \cdot (x-c)$$
$$100 \cdot x = \left[\sum^{100}_{k=1} k - \sum^{x}_{k=1} k \right] + x \cdot (x-c)$$
$$100 \cdot x = \left[100 \cdot 101/2 - x \cdot (x+1)/2 \right] + x \cdot (x - c)$$
$$200 \cdot x = 100 \cdot 101 - x \cdot (x+1) + 2 \cdot x \cdot (x - c)$$
$$200 \cdot x = 10100 - x^2-x + 2 \cdot x^2 - 2 \cdot c \cdot x$$
$$0 = x^2 - (201 + 2c) \cdot x + 10100$$
quadratic formula for c=1
$$x_{1/2} = (203 \pm \sqrt(203^2 - 4 \cdot 10100)/2$$
$$x_1 = 0.5 \cdot (203 - \sqrt(809) = 87.27854$$
(ignore $$x_2 = 0.5 \cdot (203 + \sqrt(809)=115.7 > 100)$$
a few special cases for different penalties of c to throw 100-sided dice again, computed in R:
$$f <- function(x,c) {x^2 - (201+2*c)*x + 10100}$$
$$uniroot(f,c(1,100),tol=0.0001,c=0.1) => 96.08781$$
$$uniroot(f,c(1,100),tol=0.0001,c=0.5) => 90.95011$$
$$uniroot(f,c(1,100),tol=0.0001,c=1) => 87.27854$$
$$uniroot(f,c(1,100),tol=0.0001,c=2) => 82.34436$$
$$uniroot(f,c(1,100),tol=0.0001,c=3) => 78.75632$$
$$uniroot(f,c(1,100),tol=0.0001,c=5) => 73.40249$$
$$uniroot(f,c(1,100),tol=0.0001,c=10) => 64.56254$$
