# [APL (Dyalog)], <s>7</s> 5 bytes

*2 bytes saved thanks to @Mego*

<!-- language-all: lang-apl -->

    +.×⍨⍳

[Try it online!][TIO-j8vk7rlp]

**How?**

`⍳` - range

`+.×` - dot product

`⍨` - with itself


[APL (Dyalog)]: https://www.dyalog.com/
[TIO-j8vk7rlp]: https://tio.run/##SyzI0U2pTMzJT///P@1R2wRtvcPTH/WueNS7GchXOARiGBoAAA