All magmas of order n (specifically 3)

I am considering the collection of all magmas (sets with binary operations) of order 3. Since we just need a binary operation and no other properties, it makes sense to define a magma in terms of all of its binary products:

$$a*a, a*b, a*c, b*a, b*b, b*c, c*a, c*b, c*c$$.

So we have 9 products. Since we require no other properties, any of $$a, b, c$$ is a valid value for any product. So to determine our magma, we make 9 choices from a set of 3. So it seems like we have $$3^9$$ possible magmas of order 3.

However, some of these magmas are identical. For example, if we have a magma defined by our 9 equations, and we just switch the roles of $$a$$ and $$b$$ in every equation, we haven't changed the magma at all. We've just reordered our equations and relabeled our elements, but the algebraic structure is the same. So by swapping $$a$$, $$b$$, and $$c$$, we keep our magma the same.

The amount of permutations of a list of length 3 is $$3!$$. So it seems like a given magma should have $$3!$$ ways of being defined by our 9 equation method.

So this leads us to the conclusion that we have $$\frac {3^9} {3!}$$ possible magmas of order 3. The only issue is that this is not an integer. Obviously, a non-integer value for the number of possible magmas does not really make sense, so what have I done wrong here?

This idea can also be extended to the number of magmas of order n. Using similar logic would lead us to believe that it should be $$\frac {n^{n^2}} {n!}$$, but in general, this is not an integer.

So what is the correct way to find the number of magmas of order n? If a general method doesn't exist or is overly complicated, then I am fine with focusing on the $$n = 3$$ case.

• The issue is that for some magmas, some of the 6 others which are isomorphic are actually equal. For instance $x^2=x$ and $xy=z$ when $x\ne y$ defines a magma which is the same as all of it's 6 permutations. In your counting, this one magma is counted as 1/6 of one. To count orbits under $S_3$ like this, use Burnsides lemma Oct 27 '19 at 4:12
• @vujazzman I see what you're saying. So for that magma, there are not actually 6 ways to define with this 9-equation method. And I can see how to use Burnside's lemma for this, though it seems tricky. But I will see what I can do! Oct 27 '19 at 20:10

I wrote a program to apply Burnside's lemma to determine the number of nonisomorphic magmas of order $$n$$. Turn's out its in OEIS. Linked there is this reference specifically on the $$n=3$$ case.