On Dec 13, 2007 2:22 PM, Arie Groeneveld <[EMAIL PROTECTED]> wrote:
> Raul I'm in doubt if your verb always produces a correct answer.
> So please follow me on this:
...
> But for n=62 there are no k,k+1 <= 62 for which
>  'k and k+1 are not divisors of X' is true.

You are correct, that my allbut2f does not recognize
"no solution" cases.

Here's a version which addresses that issue:

allbut2g=:3 :0
 n=.1+i.y
 q=._ q: n
 s=.(*."1 1:=+/)(="1 >./)q
 (*./x:n)%>./(_ q:inv s)*adja n*(n e.p:I.>./s)*.adja+./"1 s
)
adja=:[: +./ 1 _1 |.!.0"0 _ ]
last=:</\&.|.

Thanks,

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

Reply via email to