Mathematical Logical Problem

Hello!

I require help with a certain mathematical problem. I am playing a game with my friend, and we are inevitably stuck.

The game is simple, we have all the numbers from 1 to 500, my friend makes the first move and removes one number (He does not tell me the number, so I suppose it is "x"), and the second move is mine, I remove one number to. From then I must play by myself, I must come to a solution where the last 2 numbers, when you (+) them between themselves can be divided by 3. If they can't be divided by 3 then I have lost the game. How can I make an equation to solve this?

Best regards,

Alexander