Hi Martin!

>    (+:^:(]`(%~))) 5
>32
>    (+:^:(]`*)) 5
>32

The good old Constant function 1: will give you the benefits of
less circumlocution, better results for non-positive arguments,
and coverage of array arguments:

           +:^:(]`1:)  (,: -) 0 1 2 5
        1   2    4      32
        1 0.5 0.25 0.03125

A nice puzzle, BTW.  I was only capable to get to

           (+:@]^:[ 1:) 5
        32

on my own, ignorant of the gerund option.

                                                Martin (the other one)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to