OK, here is a review and a hint.  You see next the first ten terms of two 
related mystery sequences.  iii0 10 takes the first ten terms of the first 
sequence, and iii1 10 takes the first 10 terms of the second sequence.  Here is 
the hint: consider the result of replacing ,: by another verb.

    (iii0 ,: iii1) 10
1 4  7 10  13  16  19  22  25  28  <-- take 10 from first sequence
0 4 20 54 112 200 324 490 704 972  <-- take 10 from second sequence

Your task is to write the verbs iii0 and iii1.  iii0 n takes the first n terms 
of the first sequence, and similarly for iii1 n .

If you use J to help you figure out the sequences, tell what you did.  No 
peeking in Sloane.

Kip


Kip Murray wrote:
> P.S. Here are the same takes listed horizontally, easier to cut and paste.
> 
>     (iii0,:iii1) 10
> 1 4  7 10  13  16  19  22  25  28
> 0 4 20 54 112 200 324 490 704 972
> 
>     (v0,:v1) 10
> 1  6  31   76  141   226   331   456    601    766
> 0 _6 _32 _108 _384 _1250 _3456 _8232 _17408 _33534
> 
> 
> Kip Murray wrote:
>> wow
>>
>> Also, one may propose a favorite sequence.  I have two pairs to offer.  The 
>> first pair is almost too easy. The second pair is harder but you may get it 
>> if 
>> you understand the first pair.  Provide definitions for the verb pair iii0, 
>> iii1 
>> and the pair v0, v1 .  Each verb generates takes from a sequence:
>>
>>     (iii0,.iii1) 10   NB. takes listed vertically
>>   1   0
>>   4   4
>>   7  20
>> 10  54
>> 13 112
>> 16 200
>> 19 324
>> 22 490
>> 25 704
>> 28 972
>>
>>     (v0,.v1) 10
>>    1      0
>>    6     _6
>>   31    _32
>>   76   _108
>> 141   _384
>> 226  _1250
>> 331  _3456
>> 456  _8232
>> 601 _17408
>> 766 _33534
>>
>> If you use J to help figure these out, tell!
>>
>>
>> Roger Hui wrote:
>>> p:@(+/)@(i.!])@>@i.
>>>
>>> Why is it my favorite?  The function does not contain
>>> any of the digits 0-9.
>>>
>>>
>>>
>>> ----- Original Message -----
>>> From: Kip Murray <[email protected]>
>>> Date: Monday, August 17, 2009 12:16
>>> Subject: Re: [Jprogramming] Takes from a mystery sequence
>>> To: Programming forum <[email protected]>
>>>
>>>> Part three: Propose your favorite
>>>>
>>>> Kip Murray wrote:
>>>>> Part two: If you used J to help you figure out the sequence, tell
>>>>>
>>>>> Kip Murray wrote:
>>>>>> Verb i. produces takes from the sequence of non-negative integers:
>>>>>>
>>>>>>      i.20
>>>>>> 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
>>>>>>      i.5
>>>>>> 0 1 2 3 4
>>>>>>      5 {. i.20
>>>>>> 0 1 2 3 4
>>>>>>
>>>>>> Verb s generates takes from a mystery sequence (no peeking in 
>>>> Sloane, please)
>>>>>>      s 13
>>>>>> 2 3 7 19 53 131 311 719 1619 3671 8161 17863 38873
>>>>>>      s 5
>>>>>> 2 3 7 19 53
>>>>>>      5 {. s 13
>>>>>> 2 3 7 19 53
>>>>>>
>>>>>> Your mission, should you decide to accept it, is to provide a 
>>>> definition for s . 
>>>>>>    As always, these instructions will
>>> ----------------------------------------------------------------------
>>> 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
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to