Skip to main content
added 21 characters in body
Source Link
flawr
  • 44.1k
  • 7
  • 109
  • 253

Haskell, 33 bytes

(a#b)x=sum[1|0<-mod<$>[a..b]<*>x] 

Try it online!

Explanation:

(a#b)x --take two values a and b and the list x [a..b] --generate the range a, a+1, ... , b mod<$>[a..b] --partially apply "mod" to each entry of the list mod<$>[a..b]<*>x --apply the partially applied functions to all values of the list x [1|0<-mod<$>[a..b]<*>x] --generate a new list with a one for every zero in the resultingpreviously computed list (a#b)x=sum[1|0<-mod<$>[a..b]<*>x] --sum it all up 

Haskell, 33 bytes

(a#b)x=sum[1|0<-mod<$>[a..b]<*>x] 

Try it online!

Explanation:

(a#b)x --take two values a and b and the list x [a..b] --generate the range a, a+1, ... , b mod<$>[a..b] --partially apply "mod" to each entry of the list mod<$>[a..b]<*>x --apply the partially applied functions to all values of the list x [1|0<-mod<$>[a..b]<*>x] --generate a new list for every zero in the resulting list (a#b)x=sum[1|0<-mod<$>[a..b]<*>x] --sum it all up 

Haskell, 33 bytes

(a#b)x=sum[1|0<-mod<$>[a..b]<*>x] 

Try it online!

Explanation:

(a#b)x --take two values a and b and the list x [a..b] --generate the range a, a+1, ... , b mod<$>[a..b] --partially apply "mod" to each entry of the list mod<$>[a..b]<*>x --apply the partially applied functions to all values of the list x [1|0<-mod<$>[a..b]<*>x] --generate a new list with a one for every zero in the previously computed list (a#b)x=sum[1|0<-mod<$>[a..b]<*>x] --sum it all up 
added 509 characters in body
Source Link
flawr
  • 44.1k
  • 7
  • 109
  • 253

Haskell, 33 bytes

(a#b)x=sum[1|0<-mod<$>[a..b]<*>x] 

Try it online!

Explanation:

(a#b)x --take two values a and b and the list x [a..b] --generate the range a, a+1, ... , b mod<$>[a..b] --partially apply "mod" to each entry of the list mod<$>[a..b]<*>x --apply the partially applied functions to all values of the list x [1|0<-mod<$>[a..b]<*>x] --generate a new list for every zero in the resulting list (a#b)x=sum[1|0<-mod<$>[a..b]<*>x] --sum it all up 

Haskell, 33 bytes

(a#b)x=sum[1|0<-mod<$>[a..b]<*>x] 

Try it online!

Haskell, 33 bytes

(a#b)x=sum[1|0<-mod<$>[a..b]<*>x] 

Try it online!

Explanation:

(a#b)x --take two values a and b and the list x [a..b] --generate the range a, a+1, ... , b mod<$>[a..b] --partially apply "mod" to each entry of the list mod<$>[a..b]<*>x --apply the partially applied functions to all values of the list x [1|0<-mod<$>[a..b]<*>x] --generate a new list for every zero in the resulting list (a#b)x=sum[1|0<-mod<$>[a..b]<*>x] --sum it all up 
Source Link
flawr
  • 44.1k
  • 7
  • 109
  • 253

Haskell, 33 bytes

(a#b)x=sum[1|0<-mod<$>[a..b]<*>x] 

Try it online!