In article <[EMAIL PROTECTED]>,
        "Jonathan E. Paton" <[EMAIL PROTECTED]> writes:
>> > This is in fact unexpectedly challenging. a 43 is easy. A 40 is hard.
>> 
>> Here's mine
>> 
>> $m=pop;for(1..$m-1){$n+=$m%$_?0:$_}print $n
>> 
>> 43, if I understand the rules correctly.  (First attempt at this... been
>> wanting to play since I read about it on /.)

Unfortunately you don't. This solution misses the requested \n, fixing
that makes it a 46

> 
> Hang on... can't that be changed to:
> 
>   $m=pop;$n+=$m%$_?0:$_ for 1..$m-1;print$n
> 
> to shave some characters?  Untested... [I just switched my Linux system
> off]... but that'd be my next attempt.  If it works, it is 41 characters,
> you might be able to get rid of the space between "for 1".  I can't
> believe you left the space in between "print" and "$n" though!
> 
which would then be 44

Reply via email to