s = 0
unseen = 1
seen(v) = bit test(s, v)
see(v) = s = bit or(s, 2^v); while (seen(unseen), unseen++)

M = 1000000

find(m) = fordiv (m, d, if (!seen(d), return (d)))

{
	k=0;
	for (n=1, oo,
		v = find(n*(n+1)/2);
		if (v==unseen,
			print (k++ " " n);
			if (k==10 000,
				break;
			);
		);
		if (v<M,
			see(v);
			if (unseen==M,
				break;
			);
		);
	);
}

quit