Marcelo E. Magallon ([EMAIL PROTECTED]) wrote:
>  Regarding my "one step" solution, the secret can be computed as:
> 
>     Op(i=1..digits, C(i, digits)*digit[i])
> 
>  where Op(a,b) := (0, 1..9, 1..9, ...)[a+b] and C(i, j) := j!/i!/(j-i)!
>  (or something like that, I can't think straight right now).  This lead
>  to a horribly long solution that doesn't even pass the test program :-)

"One step" for very unusual bindings of "one" ;-)

I also thought of this.  However you can avoid messing around with
factorials by simply extracting digits from the powers of 11.

I'm just gutted that I had considered *1.1 and then rejected it as
being too much hassle to remove the two outer digits.  If only I'd
realised I could have done that in 3 extra characters!

Ah well.  At least mine was the best entry did the magic op, the pop,
and removal of the trailing digit all within one s///ge.  Small
comfort ...

Reply via email to