[Jprogramming] Sequence generation
Xiao-Yong Jin
jinxiaoyong at gmail.com
Thu Sep 28 19:37:08 UTC 2017
> On Sep 28, 2017, at 1:40 PM, Raul Miller <rauldmiller at gmail.com> wrote:
>
> That is what I would assume:
>
> 4,(4+5),(4+5+6),(4+5+6+7),(4+5+6+7+8)
> 4 9 15 22 30
>
> I was trying to figure out a recursive approach which isn't vastly
> more tedious...
4( [, +( ([,+)`$:@.(10>]) ) >:@])5
On the other hand, ^: can be used, but I don't see any simpler.
>
> Thanks,
>
> --
> Raul
>
>
> On Thu, Sep 28, 2017 at 2:39 PM, Roger Hui <rogerhui.canada at gmail.com> wrote:
>> You don't mean
>>
>> +/\4+i.10
>> 4 9 15 22 30 39 49 60 72 85
>>
>> do you?
>>
>>
>>
>> On Thu, Sep 28, 2017 at 11:33 AM, Skip Cave <skip at caveconsulting.com> wrote:
>>
>>> What is a good way to generate this sequence in J?
>>>
>>> 4,(4+5),(4+5+6),(4+5+6+7),(4+5+6+7+8)+.....
>>>
>>> Show one way using i. and insert.
>>>
>>> Show another way using recursion.
>>>
>>> Skip
>>>
>>> Skip Cave
>>> Cave Consulting LLC
>>> ----------------------------------------------------------------------
>>> For information about J forums see http://www.jsoftware.com/forums.htm
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list