Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

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

Search the Archive

Seaching in Pi a sequence. Looking for a faster method

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119562] Seaching in Pi a sequence. Looking for a faster method
  • From: Guillermo Sanchez <guillermo.sanchez at hotmail.com>
  • Date: Fri, 10 Jun 2011 06:38:05 -0400 (EDT)

Dear Group

I have developed this function

piesimo[n_, m_, r_] := Module[{a}, a = Split[RealDigits[Pi - 3, 10, n]
[[1]]]; Part[Accumulate[Length /@ a], Flatten[Position[a, Table[m,
{r}]]] - 1] + 1]

n is the digits of Pi, after 3, where to search a sequence of m digit
r times consecutives.
For instance:

piesimo[10^7, 9, 7]

Gives that the sequence 9999999 happens in positions:

{1722776, 3389380, 4313727, 5466169}

I know that in this group I will find  faster methods. Any idea?

Guillermo



  • Prev by Date: Re: Curve Tracking and fetching Locator coordinates
  • Next by Date: Re: querries
  • Previous by thread: Re: Fast way to find neighbours of vertices in a Graph & possible performance bug in NeighborhoodGraph
  • Next by thread: Re: Seaching in Pi a sequence. Looking for a faster method