Here's another approach:

   f=: [ * i.@<.@%~
   60 -.&(f&1000) 24
60 180 300 420 540 660 780 900

Of course, you could easily replace f with it definition (in
parenthesis), since it's referenced only once.

But this way it's easy to see what f is doing:

   60 f 1000
0 60 120 180 240 300 360 420 480 540 600 660 720 780 840 900


Thanks,

-- 
Raul

On Tue, Dec 19, 2017 at 3:40 PM, chris burke <[email protected]> wrote:
>>  I.1=#.|:0=24 60 |/i.1001
>
> Slightly simpler:
>
> I.</0=24 60 |/i.1001
>
> 60 180 300 420 540 660 780 900
>
>
>
> On Tue, Dec 19, 2017 at 11:25 AM, Raul Miller <[email protected]> wrote:
>
>> Here's one approach:
>>
>>    I.1=#.|:0=24 60 |/i.1001
>> 60 180 300 420 540 660 780 900
>>
>> Thanks,
>>
>> --
>> Raul
>>
>>
>> On Tue, Dec 19, 2017 at 1:52 PM, 'Skip Cave' via Programming
>> <[email protected]> wrote:
>> > How many numbers from 1 to 1000 are divisible by 60 but not by 24?
>> >
>> > Here's my somewhat inelegant explicit solution:
>> >
>> >     #e=.c#~d=.-.0=24|/c=.a#~b=.0=60|/a=.1+i.1000
>> >
>> > 8
>> >
>> >
>> > NB. What are the numbers?
>> >
>> >     e
>> >
>> > 60 180 300 420 540 660 780 900
>> >
>> >
>> > How would I construct  a more compact tacit solution?
>> >
>> >
>> > 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
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to