Hope i understood how to answer to a post and that I'm not messing everything 
with new threads...


> 
>     next=.0 3+*&5
>     20 next@]^:(i.@[) 1 0
> 
> Or,
> 
> 
>     next=.5&(0 3 + *)
>     (i. 20) next 1 0
> 
> Henry Rich
> 

I
 cannot understand the first one so I used the second which works 
perfectly but, if i correctly understood how it works, it calculate 
every term of the sequence starting from the first while it would be 
enough to take the last calculated one, multiply it by 5 and then add 3,
 with a saving in time and memory that becomes really huge when you need
 some thousands of the element in the sequence, correct me if I 
misunderstood something in the code.

My question, then, is if the
 first code you posted has the same problem and, if the answer is "no", 
I'd really appreciate some explanation on how it works!
Otherwise if 
the answer is "yes" and both code share this time and memory waste is it
 possible to write a code that generate every term working on the last 
calculated one avoiding an explicit for cicle?

thank again for the time you're spending helping me!

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

Reply via email to