A loop is a pretty simple algebraic structure. It is a tuple (G,+) where G is a set and + is a binary operator G × G → G. That is + takes two elements from G and returns a new element. The operator is also required to fulfill two properties
Cancellation: For every a and b in G there exists unique x and y in G such that
a + x = b y + a = b
Identity: There is an e in G such that for every a in G
e + a = a a + e = a
If you are familiar with the concept of a group you might notice that a loop is just a group that doesn't have an associative property.
Loops are pretty simple so people like to add more rules to make new structures that are more interesting. One such structure is a Moufang loop which is a loop that also satisfies the following four identities forall x, y and z in G
z + (x + (z + y)) = ((z + x) + z) + y ((y + z) + x) + z = y + (z + (x + z)) (z + x) + (y + z) = (z + (x + y)) + z (z + x) + (y + z) = z + ((x + y) + z)
For example the following Cayley table represents a Moufang loop:
0 1 2 3 1 0 3 2 2 3 0 1 3 2 1 0
(If you are not familiar a Cayley table is a square matrix M where Mi,j is equal to i + j. It is a handy way for representing binary operators on a set.)
We can show that there is an identity rather easily it is
0. Cancellation is a little harder to show but a brute force approach yields this table
b a → 0 1 2 3 ↓ 0 0 1 2 3 1 1 0 3 2 2 2 3 0 1 3 3 2 1 0
Where our elements are the solutions to
a + x = b = x + a
(You may notice that this table is identical to our Cayley table. I'll leave it as an exercise to the reader to figure out why this is the case for this Moufang loop)
Now we need to verify the Moufang identities for our structure. There are two ways to do this for the particular structure the first way is to realize that it is associative and thus automatically fulfills the criteria, however this will not work in general so we would rather brute force the result. There are 3 free variables each with a potential of 4 values in every expression here. This means we have to perform 7*43 or 448 computations. I'll leave out the raw computations but here is some Haskell you can use to verify this.
Given a positive integer n as input output the number of Moufang loops that have order n. (the order of a group is the size of the set)
This is code-golf so answers will be scored in bytes with fewer bytes being better.
Here is the number of Moufang loops for the first 71 inputs