Is that right Prime?
That's a very strong hint. Indeed, the formula has to do with exactly that.
Let me change the rules of the game a little.
Instead of leaving the last coin for your opponent, you must take the last coin to win.
Interestingly, the key positions do not change. E.g., for the new rules {1,2,3} position is still lost for the player who has to move from it. Only those key positions are reversed, where there is not more than one row with more than one coin remaining. For example, {1,1,1} becomes a position from which you can force a win if it is your turn to move.
The reason for the rule change is to keep the formula consistent. With the old rules (win if your opponent takes the last coin), the formula for the key position works only while there are more than one row with more than one coin left. After that you just have to leave odd number of rows with one coin each to your opponent. With the new rules (one who takes the last coin -- wins), the formula for the key position works all the way to the end.
I suppose, this could be a hint too.
As I said earlier, I remember the formula, but forgot the derivation. So don't count on my help too much. I grew too lazy (perhaps, incapable) to duplicate the derivation/proof I did twenty some years ago. I would like someone else to do it and publish the proof here.