d = {} for p in range(1, 100) for t in range(p, 100, p) if d.hasIndex(t) then d.remove t else d.push t end for end for print d.indexes.sort