Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
2 bytes saved thanks to @Mego
Try it online!
⍳ - range
+.× - inner product (a +.× b → +/ a × b)
a +.× b
+/ a × b
⍨ - with itself (on both sides)