I didn't realize you also wanted the intermediate results.  The others have 
provided you answers; but for future reference and exploration:  J provides you 
many tools.

Here's an (ugly) answer using  ^:  :

           ug =. 2 : '[: >@:({."1) (2&(u&.>/@:{. , }.)^:(1 < #)^:n @: (; 
<"_1@:|.)~)'
        
           L =. 2 4 6 8 10 
           R =. i. 2 2
        
           L + ug _  R  NB.  Just final result
        30 31
        32 33
        
           L + ug a: R NB.  Intermediate results
         0  1
         2  3
        
        10 11
        12 13
        
        18 19
        20 21
        
        24 25
        26 27
        
        28 29
        30 31
        
        30 31
        32 33

-Dan  
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to