Let's say I imported a large list of numbers into Mathematica, and found the min value and max value. In that range [min,max], how do I find all integers that do not appear in this list?
data = Flatten[Import["file.txt", "Table"]];
M = Max[data]
m = Min[data]
Using
newdata = DeleteDuplicates [data];
Sort[newdata]
I get this:
The range of values are
{19,20,22,..., 126, 128}
So I can tell that 21, for example, is missing
Range[Max[data]]
that are not present indata
? Have you seenComplement[]
? $\endgroup$ – J. M.'s ennui♦ Apr 11 '18 at 5:46