Arie Groeneveld improved:
> zUr917=: ([:;<@#:@>:)^:(]`0:)
Damn, you beat me to it! So now we see that this is completely equivalent
to your recurrence 1relation, even the first two elements:
rabS=:(([:$:_1+]),[:$:_2+])^:(1<])
#.\ rabS 5
1 2 5 11 22 45 90 181
#.\ zUr917 5
1 2 5 11 22 45 90 181
BTW I stole the idea for this verb and its friend from the OEIS:
http://www.research.att.com/~njas/sequences/A005614
I'm sure other mechanisms can be found there. Actually, I'd like to see all
the approaches you've already collected; have you considered putting up an
Essay or a Puzzle on the Wiki?
-Dan
--
View this message in context:
http://www.nabble.com/How-to-behead-included--tf4778131s24193.html#a13683397
Sent from the J Programming mailing list archive at Nabble.com.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm