"Chuck Crayne" <ccrayne@[EMAIL PROTECTED]
> wrote in message
news:20080721131949.44aac8b5@[EMAIL PROTECTED]
> On Mon, 21 Jul 2008 04:18:17 -0400
> "Rod Pemberton" <do_not_have@[EMAIL PROTECTED]
> wrote:
>
> > But for length 4, some of the div indexes will exceed the
> > string length... (Um, maybe?...)
>
> Yes, for length 4, the maximum Pn will be 23, and so the initial
> divisor must be 6. After which the remainder will become the Pn value
> for a length 3 string, for which you already have the solution.
>
> In the general case, for length L, the first divisor is (L-1)!, and
> each iteration decrements the length by one. Thus this step is the
> induction rule, and the length 3 case is the base case. Therefore the
> generalized algorithm is valid for all possible string lengths.
>
Thanks.
> Do you understand it now?
Not sure... I'll have to work through it.
But, my preliminary thought is that the using the remainder of one stage
for
the shorter string in the next stage is a problem, i.e., it will still
exceed array boundary conditions on the next shorter string.
Rod Pemberton


|