A=: 1 2 3 10 100 987654321x
B=: 1+{:A
C=: B#.A
B #.inv C
|nonce error
| B #.inv C
Hypothetically speaking, we want something that can find A, given B and C.
Perhaps
A-:((>.B^.C)#B)#:C
1
or
A-:B (((<.@%~,|){.),}.@])^:(<: {.)^:_ C
1
I ran into this while playing with
http://rosettacode.org/wiki/Index_finite_lists_of_positive_integers
Currently, the J version is broken for the numeric list listed in the
python solution, and that's just silly. I could fix it easily enough,
but I've enough other things to do already.
Thanks,
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm