big = 1 000 000
s = 0
S = []
unseen = 1
seen(v) = if (v < big, bittest(s, v), setsearch(S, v))
see(v) = if (v < big, s = bitor(s, 2^v), S = setunion(S, [v])); while (seen(unseen), unseen++)

bits(n) = {
	my (b=vector(hammingweight(n)));
	for (k=1, #b, n-=2^b[k]=valuation(n,2));
	return (b);
}

{
	for (n = 1, 2^16,
		l = lcm(bits(2*n));
		forstep (m=l, oo, l,
			if (!seen(m),
				see(m);
				print (n " " m);
				break;
			);
		);
	);
}

quit