> > 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 /.)
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!
Good luck,
Jonathan Paton
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com