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 <[email protected]> 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 <[email protected]> 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 <[email protected]>
>> 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