Came up with this game, haven't thought of a catchy name for it, but here it goes:
There are $n$ marbles. Two players alternate between taking away $\frac{kn}{p}$ marbles, where $p$ is a prime number (prime divisor of $n$) and $1 \le k < p < n$ ($n$ is the current number of marbles). The players get to choose $p$ and $k$ for each turn.
The first player who can't complete their turn (i.e. when you can't take away a natural number of marbles which can be written as $kn/p$) loses.
For example, let $n = 30$. The starting player can take away $30*2/5 = 12$ marbles, which results in $18$ marbles. No matter what the second player does (take away $18*1/3$, $18*2/3$ or $18*1/2$), they result in winning states for the starting player ($6$, $9$ or $12$). So $n=30$ is a winning state.
The premise is simple, yet I have difficulties with finding a general formula to decide if a game state is winning or losing. I've tried constraining $p$, and managed to find a pattern which was easily provable, but I haven't been able to work it out for all possible $p$.
Other than the obvious (prime numbers are losing states, etc.) I have no clue. I wrote a simple python script to try out all combinations, but that didn't help either.
Any ideas?