I was looking to solve Hackerrank w7 challenges and one problem was about the game of Nim. After that, I started to look up good introductions to Nim. I found this one interesting: comb.pdf
I found it very useful to understand the game.
This one talks about Backward induction, P-positions and N-positions. Just what is required.