# What happens when you divide by ##?

I've been playing around with sequences a bit. In particular with using ## with unary and binary operators.

Let's start simple, the following all make some kind of sense:

  + ## & [a,b] (* a + b *)
x + ## & [a,b] (* x + a + b *)
x * ## & [a,b] (* x * a * b *)
x ^ ## & [a,b] (* x ^ a ^ b *)


Now here is a slightly weird case:

  - ## & [a,b] (* -a*b *)
x - ## & [a,b] (* x - a*b *)


I guess, this sort of makes sense if - is actually interpreted as something like +(-1)*. But it also means that +##-## is generally non-zero.

But now here's the real puzzle:

x / ## & [a,b]   (* x a^(1/b) *)
x / ## & [a,b,c] (* x a^b^(1/c) *)


Wh... what? Can anyone explain what's happening here or at least give some justification like the one for subtraction? Answers which correct my explanation for subtraction are also welcome!

(No, I would never use this stuff in production code. But knowing what exactly is going on under the hood could come in handy some time.)

Bonus Question: Are there any other operators that yield unexpected and potentially "useful" results? (I mean, !## will yield Not[a,b] but that's neither very unexpected nor useful.)

• Related: (31797) – Mr.Wizard Jan 8 '15 at 19:07
• Users interested in such question should consider Trace[x/## &[a, b, c]]. – Michael E2 Aug 4 '15 at 11:19

The documentation for Minus states that

-x is converted to Times[-1,x] on input.

So -Sequence[a,b] == Times[-1,Sequence[a,b]] == Times[-1,a,b] by this definition. Similarly the documentation for Divide states that

x/y is converted to x y^-1 on input.

and therefore x / Sequence[a,b] == x Sequence[a,b]^-1. Sequence[a,b]^c == Power[a, Power[b,c]]. When c == -1 you get Power[b, -1] == 1/b.

• Accepting this, because it covers both Minus and Divide. – Martin Ender Jan 11 '15 at 15:33
x/## & // FullForm

Function[Times[x,Power[SlotSequence[1],-1]]]


and Power[a,b,c...] == Power[a, Power[b, c...]] so now it should be clear.

This syntax is mentioned in the last bullet point in details of Power documentation.

• beat me by a femtosecond – Dr. belisarius Jan 8 '15 at 18:08
• Ah, thanks a lot. I was thinking it would probably be analogous to the minus case, but couldn't work it out. I think linking to the documentation for Divide would be more useful than linking to the documentation for Power though. – Martin Ender Jan 8 '15 at 18:12