In this question what is the meaning of both player optimally played?
For n=6 if player 1 starts then i tried all cases but second player will win.
Plays to maximise the chance of winning, minimise the chance of losing, and never make a mistake.
For n=6, player 1 removes 6, and the divisors of 6 = 3, 2 and 1.
Pieces 4 and 5 remain.
Your move.
Ohhh I missed 2 in hurry.