# Meaning of ## #

While looking for an answer to a different problem, I came across the following example:

In[1]:= Array[Plus[##] &, {2,2}]
Out[1]= {{2,3},{3,4}}


Having read through the documentation on Slot and SlotSequence, I understand the above example. If we think of it as a matrix $$M_{ij}$$, it takes the two indices and adds them up, $$M_{ij}=i+j$$. I also understand that it is equivalent to Array[Plus[#1,#2] &, {2, 2}].

I tried making the expression slightly more complicated:

In[2]:= Array[Plus[##,#] &, {2,2}]
Out[2]= {{3,4},{5,6}}


which acts as $$M_{ij}=(i+j)+i$$, or if we replace the last # with #2, $$M_{ij}=(i+j)+j$$.

Now, I am really stuck on interpreting:

In[3]:= Array[Plus[## #] &, {2,2}]
Out[3]= {{1,2},{4,8}}


What is the corresponding expression for $$M_{ij}$$?

• FullForm[## #] – Kuba Dec 7 '18 at 13:30
• Thank you, as a beginner in Mathematica, I don't use FullForm as often as I should... – Jakub Kryś Dec 7 '18 at 14:02
• Hmm, I think I need to find a place to use ######& in my code. (It's perhaps less obvious what this is here than in the frontend...) – Brett Champion Dec 7 '18 at 14:42

Plus[## #] & is the same as Plus[Times[##, #1]], which always computes to the same as the simpler Times[##, #1] (because Plus[x] is just x).
Table[i^2 * j, {i, 2}, {j, 2}]