Skip to main content
added 54 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

JaptJapt -x, 25 19 17 bytes17 15 bytes

L²õÈâ ®aXËaX/ZÃd<UÃèDÃd<U

Test it


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.

Japt, 25 19 17 bytes

L²õÈâ ®aX/ZÃd<UÃè

Test it


Explanation

Implicit input of integer U.

L²õ

Generate an array of integers (õ) from 1 to 100 (L) squared.

Èâ          Ã

Pass each through a function (where X is the current element) that generates an array of the divisors (â) of X.

®    Ã

Map over that array of divisors, where Z is the current element.

aX/Z

Get the absolute difference (a) of Z and X divided by Z.

d<U

Are any of the elements (d) in the resulting array less than U?

è

Count the truthy elements and implicitly output the result.

Japt -x, 25 19 17 15 bytes

L²õÈâ ËaX/DÃd<U

Try it

L²õÈâ ËaX/DÃd<U     :Implicit input of integer U
L                   :100
 ²                  :Squared
  õ                 :Range [1,L²]
   È                :Map each X
    â               :  Divisors
      Ë             :  Map each D
       aX/D         :    Absolute difference with X/D
           Ã        :  End inner map
            d<U     :  Any less than U?
                    :Implicit output of sum of resulting array
Commonmark migration
Source Link

#Japt, 25 19 17 bytes

Japt, 25 19 17 bytes

L²õÈâ ®aX/ZÃd<UÃè

Test it


Explanation

##Explanation ImplicitImplicit input of integer U.

L²õ

Generate an array of integers (õ) from 1 to 100 (L) squared.

Èâ          Ã

Pass each through a function (where X is the current element) that generates an array of the divisors (â) of X.

®    Ã

Map over that array of divisors, where Z is the current element.

aX/Z

Get the absolute difference (a) of Z and X divided by Z.

d<U

Are any of the elements (d) in the resulting array less than U?

è

Count the truthy elements and implicitly output the result.

#Japt, 25 19 17 bytes

L²õÈâ ®aX/ZÃd<UÃè

Test it


##Explanation Implicit input of integer U.

L²õ

Generate an array of integers (õ) from 1 to 100 (L) squared.

Èâ          Ã

Pass each through a function (where X is the current element) that generates an array of the divisors (â) of X.

®    Ã

Map over that array of divisors, where Z is the current element.

aX/Z

Get the absolute difference (a) of Z and X divided by Z.

d<U

Are any of the elements (d) in the resulting array less than U?

è

Count the truthy elements and implicitly output the result.

Japt, 25 19 17 bytes

L²õÈâ ®aX/ZÃd<UÃè

Test it


Explanation

Implicit input of integer U.

L²õ

Generate an array of integers (õ) from 1 to 100 (L) squared.

Èâ          Ã

Pass each through a function (where X is the current element) that generates an array of the divisors (â) of X.

®    Ã

Map over that array of divisors, where Z is the current element.

aX/Z

Get the absolute difference (a) of Z and X divided by Z.

d<U

Are any of the elements (d) in the resulting array less than U?

è

Count the truthy elements and implicitly output the result.

added 593 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

#Japt, 25 19 17 bytes

L²õÈâ ®aX/ZÃd<UÃè

Test it


##Explanation Implicit input of integer U.

L²õ

Generate an array of integers (õ) from 1 to 100 (L) squared.

Èâ          Ã

Pass each through a function (where X is the current element) that generates an array of the divisors (â) of X.

®    Ã

Map over that array of divisors, where Z is the current element.

aX/Z

Get the absolute difference (a) of Z and X divided by Z.

d<U

Are any of the elements (d) in the resulting array less than U?

è

Count the truthy elements and implicitly output the result.

#Japt, 25 19 17 bytes

L²õÈâ ®aX/ZÃd<UÃè

Test it

#Japt, 25 19 17 bytes

L²õÈâ ®aX/ZÃd<UÃè

Test it


##Explanation Implicit input of integer U.

L²õ

Generate an array of integers (õ) from 1 to 100 (L) squared.

Èâ          Ã

Pass each through a function (where X is the current element) that generates an array of the divisors (â) of X.

®    Ã

Map over that array of divisors, where Z is the current element.

aX/Z

Get the absolute difference (a) of Z and X divided by Z.

d<U

Are any of the elements (d) in the resulting array less than U?

è

Count the truthy elements and implicitly output the result.

deleted 60 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94
Loading
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94
Loading