Sum square difference The sum of the squares of the first ten natural numbers is,
\$1^2 + 2^2 + \dots + 10^2 = 385\$

The square of the sum of the first ten natural numbers is,

\$(1 + 2 + ... + 10)^2 = 55^2 = 3025\$

Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 

\$3025 − 385 = 2640\$

For a given input n, find the difference between the sum of the squares of the first n natural numbers and the square of the sum.

Test cases

1       =&gt; 0
2       =&gt; 4
3       =&gt; 22
10      =&gt; 2640
24      =&gt; 85100
100     =&gt; 25164150


This challenge was first announced at Project Euler #6.

Winning Criteria


There are no rules about what should be the behavior with negative or zero input.
The shortest answer wins.
Jelly, &nbsp;5&nbsp; 4 bytes

Ḋ²ḋṖ


Try it online!

How?

Implements  \$\sum_{i=2}^n{(i^2(i-1))}\$...

Ḋ²ḋṖ - Link: non-negative integer, n
Ḋ    - dequeue (implicit range)       [2,3,4,5,...,n]
 ²   - square (vectorises)            [4,9,16,25,...,n*n]
   Ṗ - pop (implicit range)           [1,2,3,4,...,n-1]
  ḋ  - dot product                    4*1+9*2+16*3+25*4+...+n*n*(n-1)