Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Help with Delete cases

  • To: mathgroup at
  • Subject: [mg116232] Re: Help with Delete cases
  • From: "Sjoerd C. de Vries" <sjoerd.c.devries at>
  • Date: Tue, 8 Feb 2011 05:03:42 -0500 (EST)
  • References: <iiojml$gip$>

You can use PatternTest (abbreviated as ?) to add a logical test to a

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:

DeleteCases[list, _?(Mod[# (# + 1)/2, p] == n &)]

Cheers -- Sjoerd

On Feb 7, 12:05 pm, KenR <ramsey2... at> 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?

  • Prev by Date: Re: Help with Delete cases
  • Next by Date: Generated parameters
  • Previous by thread: Re: Help with Delete cases
  • Next by thread: Re: Help with Delete cases