I have an ordered list of integers, i.e.:
list = {1,3,5,6,8,10,12,15};
and I want to know if there is a fast way to get a list of the integers that do not appear in this list. The best thing I've come up with is
list2 = Select[Range[Nd], FreeQ[list,#]&];
which for this particular case yields
{2, 4, 7, 9, 11, 13, 14}
but I suspect there is a faster, more efficient way.
Nd >= Last[list]
thenlist2 = Range[Nd]; list2[[list]] = Nothing;
will do $\endgroup$