Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #15650
| From | "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Help with Delete cases |
| Date | 2011-02-08 10:03 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <iir4dp$6go$1@smc.vnet.net> (permalink) |
| References | <iiojml$gip$1@smc.vnet.net> |
You can use PatternTest (abbreviated as ?) to add a logical test to a pattern. You pattern is not really clear to me. You don't specify what your n and m are supposed to be, but assuming that m is the number in the table and p and n (don't use a capital N !) are provided somewhere else the following would work: n=0; p=10; DeleteCases[list, _?(Mod[# (# + 1)/2, p] == n &)] Cheers -- Sjoerd On Feb 7, 12:05 pm, KenR <ramsey2...@msn.com> wrote: > I have a list= Range[3003] I want to delete cases of n = m(m+1) mod P > from the list, but Delete cases only deletes cases matching a pattern, > i.e. > > list = DeleteCases[list,Mod[N - m(m+1)/2,P] = 0] will definitely not > work. I want to keep list, as the same identifier, throughout since > this is within a looping process. Any suggestions?
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread
Help with Delete cases KenR <ramsey2879@msn.com> - 2011-02-07 11:05 +0000 Re: Help with Delete cases "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com> - 2011-02-08 10:03 +0000
csiph-web