lnps=: 4 : 0
(i{p)+}.i.d{~i=. (i.>./)d=. 2-~/\p=. (<:x),(p:([+i.@-~)/_1 p:x,y),>:y
)

Cheers,
Louis

> On 15 Sep 2017, at 18:24, Raul Miller <rauldmil...@gmail.com> wrote:
> 
> Oh, oops...
> 
> thru=: <. + i.@(+ *@+&0.5)@-~
> biggap=: {~ (0 1 + [: (i. >./) 2 -~/\ ])
> f=: [: thru/ 1 _1 + [: biggap <./ >. >./ <. thru&.(p:inv)
> 
> Thanks,
> 
> -- 
> Raul
> 
>> On Fri, Sep 15, 2017 at 12:08 PM, Skip Cave <s...@caveconsulting.com> wrote:
>> Something is wrong with Raul's 'f'
>> 
>>   10 f 100
>> 
>> 90 91 92 93 94 95 96
>> 
>>    100 f 200
>> 
>> 114 115 116 117 118 119 120 121 122 123 124 125 126
>> 
>>     200 f 300
>> 
>> 294 295 296 297 298 299 300 301 302 303 304 305 306
>> 
>> That last list isn't in the interval 200, 300
>> 
>> Skip
>> 
>>> On Fri, Sep 15, 2017 at 7:40 AM, Raul Miller <rauldmil...@gmail.com> wrote:
>>> 
>>> Do you mean like this?
>>> 
>>> thru=: <. + i.@(+ *@+&0.5)@-~
>>> biggap=: {~ (0 1 + [: (i. >./) 2 -~/\ ])
>>> f=: [: thru/ 1 _1 + [: biggap thru&.(p:inv)
>>> 
>>> Thanks,
>>> 
>>> --
>>> Raul
>>> 
>>> On Fri, Sep 15, 2017 at 5:36 AM, Skip Cave <s...@caveconsulting.com>
>>> wrote:
>>>> Write a function f, which will list the longest set of consecutive
>>>> non-prime integers between two prime numbers in the interval x, y
>>>> 
>>>> for example:
>>>> 
>>>>   10 f 100
>>>> 90 91 92 93 94 95 96
>>>> 
>>>> 
>>>> 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
> ----------------------------------------------------------------------
> 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