We’re rewarding the question askers & reputations are being recalculated! Read more.
2 deleted 40 characters in body
source | link

Julia, 1616 14 bytes

2 bytes saved thanks to @MartinEnder

!n=sum(n=(1x=1:n).^2)⋅x

Try it online!Try it online!

How?

(1x=1:n) creates a range of 11 to n,

 .^2n exponentiate by 2and assign to (vectorized)x,

then dot product with sumx.

Julia, 16 bytes

!n=sum((1:n).^2)

Try it online!

How?

(1:n) creates a range of 1 to n,

 .^2 exponentiate by 2 (vectorized),

then sum.

Julia, 16 14 bytes

2 bytes saved thanks to @MartinEnder

!n=(x=1:n)⋅x

Try it online!

How?

(x=1:n) creates a range of 1 to n and assign to x, dot product with x.

1
source | link

Julia, 16 bytes

!n=sum((1:n).^2)

Try it online!

How?

(1:n) creates a range of 1 to n,

.^2 exponentiate by 2 (vectorized),

then sum.