05AB1E, 8 bytes
ÝDOnsnO-
ExplainationExplanation:
ÝDOnsnO- //Full program
Ý //Push [0..a] where a is implicit input
D //Duplicate top of stack
On //Push sum, then square it
s //Swap top two elements of stack
nO //Square each element, then push sum
- //Difference (implicitly printed)