ok so i dunno if peeps know how binary works, so yea. if ur writing a number in binary, it will only consist of 1's and 0's. the digit farthest to the right represents the ones place. the second to the right represents the 2's place, third to the right is 4's place, fourth to right is 8's place, and etc etc... so if you were writing the number 6 it would be 110 because there is one four, one two, and 0 ones. four + two =6. since there is a max of six marbles here is the binary for each digit 1-6.
1: 001
2: 010
3: 011
4: 100
5: 101
6: 110
Now, back to the game. you always want to make the first move. if you write out the numbers in columns it would look like this:
011
100
101
110
because the first row has three, second four, third five, fourth six. now, add each column up vertically. the column far right is 1+0+1+0=2. middle is 1+0+0+1=2. left is 0+1+1+1=3. if the sum is odd, consider that row to add up to a 1. so for the left column instead of three its really 1. if it adds up to 0 or an even number consider it a 0. For the game, we always want to give that little bitch all 0's when you add it up. The middle column and right column are already 0's when added, but the left column is messed up, as its odd. so, we can take away four marbles from any of the bottom three rows. he will go, and then you will need to make the binary thing again. if theres 1 in the top row, 0 in the second, 5 in the third, and 6 in the fourth it would be:
001
000
101
110
there is an odd number of twos, so we need to remove a two from one of the rows. in this case the only option is the bottom row. Keep doing this until you have few marbles left, and from there use common sense to beat him.