Subtract a list from a list?

When you want to display a number that is not a prime number

Table[a, {a, 1, 100}]

Please tell me how to subtract the lower list from the upper list

Select[Range[100], PrimeQ]

Try

DeleteCases[Table[a, {a, 1, 20}], Alternatives@@Select[Range[20], PrimeQ]]

which instantly returns

{1,4,6,8,9,10,12,14,15,16,18,20}

You can look up Alternatives and @@ in the help system and see if you can figure out how this works. You can even just do that part by itself and see what the result is and thus might be able to better understand how that is used by DeleteCases.

You might also study

Select[Table[a, {a, 1,20}], Not[PrimeQ[#]]&]

and see what you can learn from that. That will require figuring out # and &, but learning how to use those might significantly increase your Mathematica skill.

It is not the usual style that you will commonly see, but if this method

notPrimeQ[n_]:=Not[PrimeQ[n]]
Select[Range[20],notPrimeQ]

is more understandable for you and you can use that with confidence that you will make fewer mistakes and get more correct answers on your first try at writing anything then that might help you.

Thank you.OK.I’ll learn.

I think the function Complement will be of use to you.