Dan, till now no one came up with an improvement for my sequence
generator. So feel free using it to finish your RC contribution. The
reason I asked the forum to improve it was a language matter, not really
a speed matter (though also important).
HCF=: 1 1,[:(#(2...@#))[:;(,;@(|.@(#;.1)(],~1$~[)&.>
<@:>:;.1)&.>@{:)^:(]`(<@2:))
And here is also the 'real' recursive one:
nthHCT =: (($:@] + $:@-) $:@<:)`1:@.(3>])"0 M.
argument >: 1
nthHCT 1+i.16
1 1 2 2 3 4 4 4 5 6 7 7 8 8 8 8
Hallo Dan Bron, je schreef op 11-03-10 18:21:
> Aai wrote:
>
>> Because of a hidden order it's possible to generate the sequence [1]
>> much faster then e.g. by
>> (, ] (({~<:)+({~-)) {:)^:(_2+2^5) 1 1
>>
> I posted a naïve solution along these lines yesterday. Feel free to replace
> it with your faster versions!
>
> -Dan
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
>
>
--
Met vriendelijke groet,
=@@i
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm