A341242 Numbers whose binary representation encodes a subset S of the natural numbers such that the XOR of the binary representations of all s in S gives 0.
0, 1, 14, 15, 50, 51, 60, 61, 84, 85, 90, 91, 102, 103, 104, 105, 150, 151, 152, 153, 164, 165, 170, 171, 194, 195, 204, 205, 240, 241, 254, 255, 770, 771, 780, 781, 816, 817, 830, 831, 854, 855, 856, 857, 868, 869, 874, 875, 916, 917, 922, 923, 934, 935, 936
Offset: 1
Links
- Nick Berry, Impossible Escape?, DataGenetics blog, December 2014.
Programs
-
Python
def ok(n): xor, b = 0, (bin(n)[2:])[::-1] for i, c in enumerate(b): if c == '1': xor ^= i return xor == 0 print([m for m in range(937) if ok(m)]) # Michael S. Branicky, Feb 07 2021
Comments