I computed the nimbers and searched on OEIS.
The result is this sequence and a useful link on that page is this paper that gives a fast algorithm (which is an improvement from the naive $O(n^{3/2})$ to a somewhat $O(n^{1 + \epsilon})$).
The paper is quite recent (from 2018), which probably means that there is no known better way of calculating the nimbers.
Examples:
Let's say we have three piles, of sizes $37, 51, 87$, respectively.
Looking at the OEIS sequence, we find that the corresponding nimbers are $3, 5, 6$, respectively.
We then calculate the xor of the three nimbers, which is $0$.
This means that the original game is equivalent to a pile of $0$ nim, hence Alice loses (as she moves first and there is no legal move).
On the other hand, if the three piles are $37, 51, 83$, then the nimbers are $3, 5, 4$ and the xor of them is $2$. This means that Alice wins.
In general, Alice loses if and only if the xor of all the nimbers is equal to $0$.
It is a nim game, but the state of the game consists of not just the number of sticks remaining, but also the last move done. Each of these pairs (sticks, last move) can be given a Sprague-Grundy number just as in any other Nim-type game.
However, in this case it is easier to just build a table listing all the winning moves for each number of sticks.
$$
\begin{array}{c|l}
\text{Sticks} & \text{Winning Moves} \\
\hline
0 & - \\
1 & 1\\
2 & 1,2\\
3 & 3\\
4 & 4\\
5 & 5\\
6 & 3\\
7 & -\\
8 & 1,4\\
9 & 2,3\\
10 & 3,5 \\
...& ...
\end{array}
$$
On each new line, simply list all the moves that (if available) would lead to a position with no winning moves available. For example, for 6 sticks 3 is a winning move cause it leads to a state where the only possible winning move (3) is no longer available.
I don't see any repeating pattern yet, even when extended up to 22.
Best Answer
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 :
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.