Re: sieving out selected multiples
- To: mathgroup at smc.vnet.net
- Subject: [mg113827] Re: sieving out selected multiples
- From: Raffy <adraffy at gmail.com>
- Date: Sun, 14 Nov 2010 06:11:06 -0500 (EST)
- References: <ibl9ev$b7c$1@smc.vnet.net>
On Nov 12, 9:58 pm, Andrea <and... at radargift.com> wrote:
> What is the simplest way to delete -- i.e., remove -- the multiples an
> integer from a list?
> And what is the simplest way to delete, simultaneously, the multiples from
> more than one selected integer from a list?
>
> I couldn't find a simple Mathematica function for this.
>
> Thanks,
> Andrea
list = {1,2,3,1,1,2,2,3,3}
For a individual selected case: DeleteCases[list, 3]
For a multiple selected: DeleteCases[list, 1|2]
For all: DeleteDuplicates[list]
For all + sort: Union[list]
For all + count: Tally[list]