Skip to main content
added 356 characters in body
Source Link
naffetS
  • 12.8k
  • 2
  • 20
  • 53

Vyxal, 8 bytes

ṡ:²∑$∑²ε

Try it Online!

How?

ṡ:²∑$∑²ε
ṡ        # Inclusive range between (implicit) second input and (implicit) first input
 :       # Duplicate this range
  ²      # Square each of the duplicate
   ∑     # Summate
    $    # Swap so the other range is at the top
     ∑   # Summate
      ²  # Then square
       ε # Absolute difference between the two

Vyxal, 8 bytes

ṡ:²∑$∑²ε

Try it Online!

Vyxal, 8 bytes

ṡ:²∑$∑²ε

Try it Online!

How?

ṡ:²∑$∑²ε
ṡ        # Inclusive range between (implicit) second input and (implicit) first input
 :       # Duplicate this range
  ²      # Square each of the duplicate
   ∑     # Summate
    $    # Swap so the other range is at the top
     ∑   # Summate
      ²  # Then square
       ε # Absolute difference between the two
Source Link
naffetS
  • 12.8k
  • 2
  • 20
  • 53

Vyxal, 8 bytes

ṡ:²∑$∑²ε

Try it Online!