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 we generalize on the other approaches but realize the same solution. The difference is that here we do not presume a stopping rule of the form suggested, but rather prove it is optimal.
We note that however many prior turns have been should not impact our current decision. It follows immediately that we should take the first roll (since we will not lose money even if we decide to stop after 1 roll). We thus take a fully probabilistic approach, whereby we stop after having seen a value $i$ with probability $p_i$, or $p=(p_1, p_2, \dots, p_{100})$. Then, defining $V(p) = \sum_i p_i i$, we have that our expected winnings, as a function of $p$ is:
$$
W(p) = -1 + \left(1 - \sum_i \frac{p_i}{100}\right)W(p) + \frac{V}{100}
$$
where the middle term captures the expected winnings when we do not stop.
Rearranging gives:
$$
W(p) = \frac{V - 100}{\sum_i p_i}
$$
Then,
$$
\frac{dW}{dp_j} = \frac{j \sum_i p_i - V + 100}{\left(\sum_i p_i\right)^2}
$$
Note that this is strictly monotonically increasing in the index $j$. Thus, there can be at most a single value $j_0$ for which the above value is 0. For all $j > j_0$, the gradient is positive, and thus to maximize $W(\cdot)$, $p_j = 1$. Similarly, for all $j < j_0$, the gradient is negative, and thus $p_j = 0$. If there is such a value $j_0$, we let $k = j_0$. Otherwise, we let $k$ be the smallest index for which the gradient is positive. Then,
$$
k \sum_i p_i - V = -(1 + 2 + \dots + (100 - k))
$$
We note that $\sum_{i=1}^{13} i = 91$ and $\sum_{i=1}^{14} i = 105$. Thus, there is no $j_0$ value. Therefore, $100 - k = 13$ or $k = 87$. This then gives the rule: stop if the value seen is $\geq 87$.
