An even number of two coin piles is losing for the first player. As second player, just pair the piles up and what the first player does to any pile you do to its match. You can go through the two pile game first to give the idea.
Added: if you want to show strong induction, I would use the proposition that two equal-sized piles is a second player win. Base case is $(0,0)$, then if proved up to $(n,n)$ the first move from $(n+1,n+1)$ is to $(n+1,m)$ with $m \le n$ and the second player can move to $(m,m)$ which we know is a win. The problem with an even number of piles of $2$ for this purpose is you really have to prove for an even number of $2$'s plus and even number of $1$'s. This makes a two dimensional induction-for no piles of $2$ you have a win with no piles of $1$, with two piles of $1$, etc. Then you can induct on the (even) number of piles of $2$.
It's not a nim game, it's an Hackenbush game (Blue-Red version if $A\cap B=\emptyset$)
Replace each number by a line segment of color red for number from $A$, and blue for $B$. To each pile of number, build a pile of line segment, by decreasing order of number.
For example, if $A$ are even numbers, and $B$ are odd numbers, the pile $[3,4,7,8,10]$ will be replace by ground-red(for 10)-red(for 8)-blue(for 7)-red(4)-blue(3).
Hackenbush games are not nim games. To each finite position can be assigned a dyadic number whose sign will give the player who can win.
EDIT : strategy explained for player x :
To each number (from $A$) in each pile, $x$ will assign a value that will be :
- $1$ if this the largest number of the pile
- $1$ if the next larger number was assigned 1 and is from the same set ($A$ or $B$)
- $2^{-n}$ where $n$ is the distance to the closest number with value $1$.
Example : in pile [10,8,7,4,3,1], 10 will have value 1 (by rule 1), 8 value 1 (by rule 2), and 4 value $\frac{1}{4}$ (by rule 3).
For player y, 7 will be assigned value $\frac{1}{2}$ (rule 2 does not apply here because the next larger number 8 is not from the same set, so rule 3), 3 value $\frac{1}{8}$, and 1 value $\frac{1}{16}$.
The best strategy is to remove the number of lowest value. (This is not the quickest strategy !)
If you add all values for player x and subtract all values for player y, a positive sum means player x has a winning strategy, negative sum is for player y while a zero sum means second player.
Best Answer
For $\ N=2\ $ it's fairly easy to tabulate the losing positions for the first player (i.e. $\ \mathcal{P}$-positions, or "safe" positions, according to the standard terminology), although I haven't found any simple expression for them. The first few are $\ \left\{1,2\right\}$, $\left\{3,5\right\}$, $\left\{4,7\right\}$, $\left\{6,10\right\},\ $ and so on.
It follows from this that simply removing one coin from both piles is not usually a good strategy. The position $\ \left\{5,7\right\}\ $, for instance is an $\ \mathcal{N}$-position in which the only winning moves are to take either $2$ coins from both piles, or $4$ coins from the pile of $7$, in both cases leaving one's opponent with the $\ \mathcal{P}$-position, $\left\{3,5\right\}\ $. Taking one coin from both piles, on the other hand, leaves one's opponent with the $\ \mathcal{N}$-position,$\ \left\{2,6\right\}\ $, from which he or she can win by taking $5$ coins from the pile of $6$.
The list, $\ \left\{a_1,b_1\right\}, \left\{a_2,b_2\right\},\dots, \left\{a_i,b_i\right\}, \dots, \ $ of $\ \mathcal{P}$-positions is constructed recursively as follows:
If we put $\ P_n=\left\{\left\{a_i,b_i\right\}\left|i=1,2,\dots,n\right.\right\}\ $ then it's easy to demonstrate that:
We can now show by induction that the set of $\ \mathcal{P}$-positions is $\ P=\bigcup_{i=1}^\infty P_i\ $.
First, let $\ \left\{a,b\right\}\not\in\ P\ $, with $\ a\le b\ $. If $\ a=b\ $, then the first player can win immediately by taking all the coins from both piles. Otherwise, if $\ r= b-a\ $, then either $\ a=a_k\ $ or $\ a=b_k\ $ for some $\ k\ $. In the first case, since $\ \left\{a,b\right\}\not\in\ P_r\ $, we must have $\ a> a_r\ $, and the first player can leave the second with the position $\ \left\{a_r,b_r\right\}\in P_r\ $ by removing $\ a-a_r\ $ coins from both piles. In the second case, the first player can leave the second with the position $\ \left\{a_k,b_k\right\}\in P_k\ $, again with $\ a_k < a\ $, by removing $\ b-a+k=b-a_k\ $ from the pile of $\ b\ $. In position $\ \left\{1,2\right\}\ $ there are only four moves possible for the first player:
Thus, the position $\ \left\{1,2\right\}\ $ is a $\ \mathcal{P}$-position. Suppose now that all positions in $\ P_{n-1}\ $ are $\ \mathcal{P}$-positions, and consider the position $\ \left\{a_n,b_n\right\}\ $. If the first player takes all the coins from either pile, then the second player wins immediately by taking all the coins from the other. If he or she takes $\ c < a_n\ $ coins from the $\ a_n\ $ pile, then the new position, $\ \left\{a_n-c,b_n\right\}\ $, cannot be in $\ P\ $, because $\ b_n-\left(a_n-c\right)=n+c\ $ but $\ a_n-c< a_{n+c}\ $. If he or she takes $\ c \le n\ $ coins from the pile of $\ b_n\ $, the new position, $\ \left\{a_n,b_n-c\right\}\ $ again cannot be in $\ P\ $, because $\ b_n-c-a_n = n-c\ $, and either $\ n-c=0\ $, or $a_n \ne a_{n-c}\ $. If he or she takes $\ c\ $ coins from the $\ b_n\ $ pile, with $ n<c< b_n\ $, then the new position, $\ \left\{b_n-c, a_n\right\}\ $ cannot be in $\ P\ $, because $\ a_n\notin B\ $. Finally, if the first payer takes $\ c\ $ coins from both piles, the new position, $\ \left\{a_n-c,b_n-c\right\}\ $ cannot be in $\ P\ $ because $\ b_n-c-\left(a_n-c\right)=n\ $, and $\ a_n-c < a_n\ $. Thus, from the argument above, whatever the first player does, the second player can either win immediately, or move the position to $\ \left\{a_k, b_k\right\}\in P_k\ $ with $\ k < n\ $, which is a $\ \mathcal{P}$-position by the induction hypothesis. Thus $\ \left\{a_n, b_n\right\}\ $ is a $\ \mathcal{P}$-position, and it follows by induction that all positions in $\ P\ $ are $\ \mathcal{P}$-positions.
On the other hand, the argument above shows that a player faced with a position not in $\ P\ $ can always either win immediately, or move the game to a $\ \mathcal{P}$-position in $\ P\ $, so a position is a $\ \mathcal{P}$-position, if and only if it is in $\ P\ $.
Addendum: I have just become aware that the $2$-pile version of this game is known as Whytoff's game, its solution having already been given by the Dutch mathematician Willem Whytoff in 1907.