We’re rewarding the question askers & reputations are being recalculated! Read more.
3 added 42 characters in body
source | link

APL (Dyalog), 7 5 bytes

2 bytes saved thanks to @Mego

+.×⍨⍳

Try it online!Try it online!

How?

- range

+.× - innerdot product (a +.× b+/ a × b)

- with itself (on both sides)

APL (Dyalog), 7 5 bytes

2 bytes saved thanks to @Mego

+.×⍨⍳

Try it online!

How?

- range

+.× - inner product (a +.× b+/ a × b)

- with itself (on both sides)

APL (Dyalog), 7 5 bytes

2 bytes saved thanks to @Mego

+.×⍨⍳

Try it online!

How?

- range

+.× - dot product

- with itself

2 added 42 characters in body
source | link

APL (Dyalog), 77 5 bytes

2 bytes saved thanks to @Mego

+/(.×⍨⍳)

Try it online!

How?

- range (1 2 3 4 5)

×⍨+.× - multiply with itselfinner product (vectorized, 1a 4+.× 9b+/ 16a 25× b)

+/ - sumwith itself (55on both sides)

APL (Dyalog), 7 bytes

+/(×⍨⍳)

Try it online!

How?

- range (1 2 3 4 5)

×⍨ - multiply with itself (vectorized, 1 4 9 16 25)

+/ - sum (55)

APL (Dyalog), 7 5 bytes

2 bytes saved thanks to @Mego

+.×⍨⍳

Try it online!

How?

- range

+.× - inner product (a +.× b+/ a × b)

- with itself (on both sides)

1
source | link

APL (Dyalog), 7 bytes

+/(×⍨⍳)

Try it online!

How?

- range (1 2 3 4 5)

×⍨ - multiply with itself (vectorized, 1 4 9 16 25)

+/ - sum (55)