你和朋友正在玩以下Nim游戏: - 起初,桌上有一堆石头. - 你和你的朋友会轮流取代,你先去. - 每次轮到的人会从堆中移除1到3块石头. - 移除最后一块石头的人是赢家. 给出n,堆中的石头数量,如果可以赢得游戏,假设你和你的朋友都能发挥最佳,否则返回false. 写 Python代码来解决游戏Num.
Here's the Python code using the mathematical concept of nim-sum:

```
def can_win_nim(n):
    return n % 4 != 0
```

Explanation:
If n is a multiple of 4, then no matter how many stones you take, your opponent can take enough stones to make the total number of remaining stones to be a multiple of 4, making you lose the game. In all other cases, you can always win the game by taking the number of stones such that the total number of remaining stones is a multiple of 4.

Thus, we return `True` if n is not a multiple of 4, and `False` otherwise.