Functions with Variable Numbers of Arguments is a flat function,
a pattern like f[x_, y_] stands only for instances of the
function with exactly two arguments. Sometimes you need to set
up patterns that can allow any number of arguments. You can do
this using multiple blanks . While a single blank such as x_
stands for a single Mathematica expression, a double blank such
as x__ stands for a sequence of one or more expressions. stands
for the sequence of expressions (a, b, c) Here is a more
complicated definition, which picks out pairs of duplicated
elements in h The definition is applied twice, picking out the
two paired elements. "Double blanks" __ stand for sequences of
one or more expressions. "Triple blanks" ___ stand for sequences
of zero or more expressions. You should be very careful whenever
you use triple blank patterns. It is easy to make a mistake that
can lead to an infinite loop. For example, if you define p[x_,
y___]:=p[x] q[y] , then typing in p[a] will lead to an infinite
loop, with y repeated