*Sometimes, mirrored Latin symbols are used in Arabic mathematical notation*

In mathematics, and in particular universal algebra, the concept of n-ary group (also called n-group or multiary group) is a generalization of the concept of group to a set G with an n-ary operation instead of a binary operation. By an n-ary operation is meant any set map from the n-th Cartesian power of G to G. The axioms for an n-ary group are defined in such a way that they reduce to those of a group in the case n=2.

The easiest axiom to generalize is the associative law. Ternary associativity is the polynomial identity (abc). The equality of the three possible bracketings of the string abcde in which any three consecutive symbols are bracketed. (Here it is understood that the equations hold for arbitrary choices of elements a,b,c,d,e in G.) In general, n-ary associativity is the equality of the n possible bracketings of a string consisting of n+(n-1) = 2n-1 distinct symbols with any n consecutive symbols bracketed. A set G which is closed under an associative n-ary operation is called an n-ary semigroup. A set G which is closed under any (not necessarily associative) n-ary operation is called an n-ary groupoid.

The inverse axiom is generalized as follows: in the case of binary operations the existence of an inverse means ax = b has a unique solution for x, and likewise xa = b has a unique solution. In the ternary case we generalize this to abx = c, axb = c and xab = c each having unique solutions, and the n-ary case follows a similar pattern of existence of unique solutions and we get an n-ary quasigroup.

An n-ary group is an n-ary semigroup which is also an n-ary quasigroup.