MathGroup Archive 2002

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

Search the Archive

Position within a list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg32920] Position within a list
  • From: "Dana DeLouis" <ng_only at hotmail.com>
  • Date: Tue, 19 Feb 2002 02:30:05 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Hello.  A long time ago someone posted an elegant solution, but I can not
find it in the Archives.
Given a list that may have repeating data, this returned the character that
was repeated the most, and its position..

The example given was a list of the first 10,000 digits of Pi.  I believe
the answer was that the number 9 was repeated 6 times around position
700 or 800.
The function was very short and elegant.
I don't believe the Split function was used, but I might be wrong.

Does anyone know how to do this?  Thank you.

lst = RealDigits[Pi,10,10000][[1]];

The list would have...
{3, 1, 4, 1, 5, 9, 2, 6, etc)


--
Dana DeLouis
Windows XP  & Mathematica 4.1
= = = = = = = = = = = = = = = = =





  • Prev by Date: Product - Integrals
  • Next by Date: Re: Output control
  • Previous by thread: Product - Integrals
  • Next by thread: Re: Position within a list