When to Stop Re-Rolling the d100

A 100-sided die shows the faces 1 to 100, each with probability 1/100. After a roll you may take the face value in dollars, or pay 1 dollar and roll again, as often as you like. Optimal play is a threshold rule: accept the first roll of tt or higher.

Conditioning on the first roll turns the value of the threshold-tt policy into a closed form: V(t)=t+1002−1−pp,p=101−t100.V(t) = \frac{t + 100}{2} - \frac{1 - p}{p}, \qquad p = \frac{101 - t}{100}.

def value(t):
    p = (101 - t) / 100
    return (t + 100) / 2 - (1 - p) / p

print(max(range(1, 101), key=value))

What integer does this print?

Answer format: enter an integer.