let's denote the set as S
if A, B in S then A^B is not in the S.
pick any element A from S, S and S^A are two distinct set between 0 and 1023
So the size of S <= 1024/2 = 512
Note that the integers between 1 and 1023 with odd number of bits set satisfy the above conditions. The number of such integers is 512.