...
Thanks.
I am not clear on the calculation you've requested. In the case of (10,9,7) the first two cards add up to 19. We don't need an aid of a computer to calculate the average payoff of the 4th draw in case of (10,9,7). It is (364-10-9-7)/49 ~ 6.9, meaning we must stay on (10,9,7) and even more so -- on (10,9,8).
However, that's a moot point, since the recursive function comes back to the case of (10,9) with the value of the draw of ~8.5653, whereupon it "decides" it is better to stay on (10,9) and discards the value of the draw. Later on the function comes back to the case of (10) with the value of the draw of ~9.5431 and again discards it in favor of 10 in hand.
Conversely, in the case of the first card of (9), the function returns the average payoff for the draw with the best strategy of ~9.5818, meaning that drawing is better.
Actual program that I ran spills out into Excel spreadsheet optimal payoffs for all first two card combinations, all first card draws, and the final result. Also showing best staying card in each case.