[Jprogramming] Another Quora problem

Henry Rich henryhrich at gmail.com
Tue Dec 19 19:21:45 UTC 2017


    numaliquotsbelow =: <.@(%~ <:)
    1000 -&(60&numaliquotsbelow - (60*.24)&numaliquotsbelow) 60
8
    1000 -&(60&numaliquotsbelow - (60*.24)&numaliquotsbelow) 59
8
    1000 -&(60&numaliquotsbelow - (60*.24)&numaliquotsbelow) 61
7
    1000 -&(60&numaliquotsbelow - (60*.24)&numaliquotsbelow) 1
8

Henry Rich



On 12/19/2017 1:52 PM, 'Skip Cave' via Programming 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


---
This email has been checked for viruses by AVG.
http://www.avg.com



More information about the Programming mailing list