Solution:
The answer is 3number of 1’s in binary expansion of 2021=38=6561.
Throughout this solution, we say two nonnegative integers overlap in the 2ℓ position if their binary representations both have a 1 in that position. We say that two nonnegative integers overlap if they overlap in some position. Our central claim is the following.
Claim 1. A triple (x,y,z) is losing if and only if no two of x,y,z overlap.
Let dℓ(a) denote the bit in the 2ℓ position of the binary representation of a. Let & denote the bitwise and operation: x&y is the number satisfying dℓ(x&y)=dℓ(x)dℓ(y) for all ℓ.
Lemma 1. Let x,y,z be nonnegative integers, at least one pair of which overlaps. Define x′=(x+y)&(x+z) and y′,z′ cyclically. At least one of the inequalities x<x′,y<y′,z<z′ holds.
Proof. Let ℓ be maximal such that two of x,y,z overlap in the 2ℓ position. We case on how many of the additions x+y,x+z,y+z involve a carry from the 2ℓ position to the 2ℓ+1 position, and on the values of dℓ+1(x),dℓ+1(y),dℓ+1(z). Because at least two of dℓ(x),dℓ(y),dℓ(z) equal 1, at least one of the additions x+y,x+z,y+z involves a carry from the 2ℓ position.
Case 1. One carry.
WLOG let x+y be the addition with the carry. Then, dℓ(x)=dℓ(y)=1 and dℓ(z)=0. Since x,y,z do not overlap in any position left of the 2ℓ position, the binary representations of z,z′ agree left of the 2ℓ position. As the additions x+z and y+z do not involve a carry from the 2ℓ position, we have dℓ(x+z)=dℓ(y+z)=1, and thus dℓ(z′)=1. Thus z′>z, as desired.
Case 2. At least two carries: x+y and x+z carry and dℓ+1(y)=dℓ+1(z)=0, or cyclic equivalent. (y+z may or may not carry.)
Let i be maximal such that dℓ+1(x)=⋯=dℓ+i(x)=1 (possibly i=0). By maximality of ℓ,dℓ+1(y)=dℓ+1(z)=⋯=dℓ+i(y)=dℓ+i(z)=0. By maximality of i,dℓ+i+1(x)=0.
If dℓ+i+1(y)=dℓ+i+1(z)=0, then dℓ+i+1(x+y)=dℓ+i+1(x+z)=1, so dℓ+i+1(x′)=1. The binary representations of x and x′ agree to the left of the 2ℓ+i+1 position, so x′>x.
Otherwise, WLOG dℓ+i+1(y)=1 and dℓ+i+1(z)=0. (Note that, here we in fact have i≥1.) Then dℓ+i+1(y+z)=dℓ+i+1(x+z)=1, so dℓ+i+1(z′)=1. The binary representations of z and z′ agree to the left of the 2ℓ+i+1 position, so z′>z.
Case 3. At least two carries, and the condition in Case 2 does not occur.
WLOG let x+y,x+z involve carries. Since the condition in Case 2 does not occur, dℓ+1(y)=1 or dℓ+1(z)=1. In either case, dℓ+1(x)=0. WLOG dℓ+1(y)=1 and dℓ+1(z)=0.
Since the condition in Case 2 does not occur, y+z does not involve a carry from the 2ℓ position. (Otherwise, x+y and y+z carry and dℓ+1(x)=dℓ+1(z)=0.) Then dℓ+1(x+z)=dℓ+1(y+z)=1, so dℓ+1(z′)=1. The binary representations of z and z′ agree to the left of the 2ℓ+1 position, so z′>z.
Proof of Claim 1. Proceed by strong induction on x+y+z. There is no base case.
Suppose by induction the claim holds for all (x,y,z) with sum less than N. Consider a triple (x,y,z) with x+y+z=N.
Suppose no two of x,y,z overlap. If all moves from this position lead to positions with a negative coordinate, (x,y,z) is a losing position, as claimed. Otherwise, the player increases or decreases all coordinates by k. Consider the smallest m such that dm(k)=1. The player's move will toggle each of dm(x),dm(y),dm(z). Since at most one of the original dm(x),dm(y),dm(z) is 1, at least two of the new dm(x),dm(y),dm(z) will be 1. So, two of the new x,y,z overlap. By induction, the new (x,y,z) is winning. Thus the original (x,y,z) is losing, as claimed.
Conversely, suppose at least one pair of x,y,z overlap. By Lemma 1, at least one of x<x′,y<y′,z<z′ holds. WLOG x<x′. Let the player to move choose k=x′−x, decrease y,z by k, and increase x by k. The new coordinates are nonnegative, as
y−k=x+y−x′≥0
because x′≤x+y, and similarly for the z coordinate. Moreover, the binary representation of the new x consists of the 1's in the binary representations of both x+y and x+z; the binary representation of the new y consists of the 1's in that of x+y but not x+z; and the binary representation of the new z consists of the 1's in that of x+z but not x+y. So, no two of the new x,y,z overlap. By induction, the new (x,y,z) is losing. Thus the original (x,y,z) is winning, as claimed.
We use Claim 1 to count the losing positions (x,y,z) with
x+y+z=2021=111111001012
In each position where dℓ(2021)=0, losing positions must have dℓ(x)=dℓ(y)=dℓ(z)=0. In each position where dℓ(2021)=1, the bit triplet (di(x),di(y),di(z)) is one of (1,0,0),(0,1,0),(0,0,1). This gives a count of 38=6561.