MathGroup Archive 2007

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

Search the Archive

Iterate Through a List

  • To: mathgroup at
  • Subject: [mg77324] Iterate Through a List
  • From: Nick <hoffmannick at>
  • Date: Wed, 6 Jun 2007 07:34:43 -0400 (EDT)

Hello! I'm (somewhat) new to Mathematica and I  need help to iterating
through a list and counting the occurrence of a number.

My list looks like:


The number that I would need to keep track of is the first in each sub-

So for the first couple {{1,0},{1,1},{2,x+x^2+x^4},{2,1+x+x^2+x^4},{4,x

I would need to keep track of 1,1,2,2,4........

It will not always be 1,2,4,5,8's.  The numbers may be completely
different on each pass.  Each sublist may be composed of more items
but the number that I need to keep track of will always be the 1st in
the sub-list.  Any help or suggestions that you can give me will be
greatly appreciated.  Thanks so much!

  • Prev by Date: Defining the Legacy Colors
  • Next by Date: Re: modify elements of arb.dimensionality matrices
  • Previous by thread: Defining the Legacy Colors
  • Next by thread: Re: Iterate Through a List