For part b I just used table and then eliminated 1's and non-integer results.
+/,((=<.)#])@(-.&1@,@(%/~))@". ;._2 data ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
