Assume a random experiment where we are allowed to roll a die multiple times (say $m$ times, $m\geq 2$). After each roll, we choose either to keep the value shown by the die (and stop rolling), or discard the value and continue rolling the die. If there are no more rolls available, we must keep the last value of the die. The objective is to obtain (on average) the largest value possible.
I thought of the following strategy: for each roll ($k=1,2,\ldots m-1$), find the optimal (largest) integer value $a_k$ such that if the die shows a value that does not exceed $a_k$, we keep rolling the die.
I found (for $m=6$) that the optimal vector is $a=(5,4,4,4,3)$, meaning that after roll $k=1,\ldots 5$, we continue to roll if the value shown by the die does not exceed $a_k$.
My question is if there are references to this type of problems in the relevant literature on Probability Theory.
Edit: So far, I have found this problem discussed in "A Collection of Dice Problems" by Matthew M. Conroy.