What would be the best way to determine a set of numbers which satisfies a given hamming distance
Say I had a 5bit number and I needed to identify the numbers which have a hamming distance >= 2.
Below is how far I have gotten. What I believe I need todo is then iterate over my list against the other entries in this list to remove the <2 entries.
Finally I believe I need another outer loop going over every possible initial entry because there maybe a different "seed" which yields a larger number of entries.
#!/usr/bin/env python
TARGET=2
num = range(2**5)
results = []
for i in num:
for j in num: # 2nd pass
tmp = i^j
if bin(tmp).count('1') >=2:
results.append(tmp)
print(set(results))