Bill Allombert on Thu, 19 Feb 2004 00:29:32 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Pattern Match within PARI/GP |
On Wed, Feb 18, 2004 at 12:18:21PM -0800, Paulo Ney de Souza wrote: > > Are there any (intelligent) pattern-matching routines in PARI/GP, or > some other package developed on top of PARI ? Fo example, suppose one > want to look for the first occurrence of the pattern: > > xyxyxy > > in the first 1-million digits of Pi ... Not that I know of. > I am doing this by brute force right now, but it occurs to me that > using something like Boyer-Moore or Knuth-Morris-Pratt may be more > eficient ... If you want to work with 10^6 digits, then you can afford to write the output to a file and use a dedicated program to analyse the output. Also there are probably more efficient programs than PARI for computing 1-million digits of Pi (and probably you can grab the digits on the net). Cheers, Bill.