JaptJapt -x
, 25 19 17 bytes17 15 bytes
L²õÈâ ®aXËaX/ZÃd<UÃèDÃd<U
Explanation
Implicit input of integer U
.Try it
L²õL²õÈâ ËaX/DÃd<U :Implicit input of integer U
Generate an array of integers (õ
) from 1 to 100 (L
) squared.
ÈâL Ã :100
Pass each through a function (where X
is the current element) that generates an array of the divisors (â
) of X
.
® ² Ã :Squared
Map over that array of divisors, where Z
is the current element.
õ :Range [1,L²]
È :Map each X
â : Divisors
Ë : Map each D
aX/ZD : Absolute difference with X/D
Get the absolute difference (a
) of Z
and X
divided by Z
.
à : End inner map
d<U : Any less than U?
Are any of the elements (d
) in the resulting array less than U
?
è :Implicit output of sum of resulting array
Count the truthy elements and implicitly output the result.