Smallest Two-Sided Nearrings For those who are unfamilar with nearrings, here is a definition.  Note that there are left-nearrings (where only the left distribution property is assumed), and right-nearrings (where only the right distribution property is assumed) as well.  I only consider two-sided nearings.

Definition.  A two-sided nearring is a triplet $(N,+,\cdot)$, where $(N,+)$ is a group and $(N,\cdot)$ is a semigroup such that we have both left and right distributive properties of the multiplication $\cdot$ over the addition $+$, namely, $$x\cdot(y+z)=(x\cdot y)+(x\cdot z) \text{ and }(x+y)\cdot z=(x\cdot z)+(y\cdot z)$$ for $x,y,z\in N$.  Of course, every additive group $(G,+)$ with identity $0_G$ can be made a two-sided nearring with the trivial multplication $g\cdot h:=0_G$ for all $g,h\in G$.  Such a nearring is called a trivial two-sided nearring.

My question is about nontrivial two-sided nearrings which are not rings (i.e., the addition $+$ is not commutative).  I know one which has $128$ elements: $N:=(\mathbb{Z}/8\mathbb{Z})\times (2\mathbb{Z}/8\mathbb{Z})\times (2\mathbb{Z}/8\mathbb{Z})$, where $$\left(a_1,b_1,c_1\right)+\left(a_2,b_2,c_2\right):=\left(a_1+a_2+c_1b_2,b_1+b_2,c_1+c_2\right)$$ and $\left(a_1,b_1,c_1\right)\cdot\left(a_2,b_2,c_2\right)$ is given by $$\left(a_1b_2+a_2b_1+a_1c_2+a_2c_1+b_1b_2+b_2c_1+c_1c_2,b_1b_2+b_1c_2+b_2c_1+c_1c_2,0\right)\,,$$
for all $a_1,a_2\in\mathbb{Z}/8\mathbb{Z}$, and $b_1,b_2,c_1,c_2\in2\mathbb{Z}/8\mathbb{Z}$.

Old Question.  Can you find a nontrivial two-sided nearring which is not a ring with the minimum number
of elements ?  This question has been answered here.

The example seen in Eran's answer in the link above is a two-sided nearring which is not a ring with the smallest number of elements.  While the addition of this example is noncommutative, the multiplication is commutative.  Therefore, I am offering a bounty price for anybody who answers the question below.

Bounty Question. What is a two-sided nearring
with the minimum number of elements which is not a ring and whose
multiplication is also noncommutative?  Please also prove that your example has the smallest number of elements amongst all two-sided nearing whose multiplication and addition are noncommutative.


A Remark (which may or may not be helpful).  If $(N,+,\cdot)$ is a two-sided nearing, then the subnearring $N^{\cdot 2}$ of $N$ generated by elements of the form $a\cdot b$, where $a,b\in N$, is a ring.  That is, $N^{\cdot 2}$ consists of all integer combinations of $a\cdot b$, where $a,b\in N$.  To show this, let $a,b,c,d\in N$.  Then, we have
$$(a+b)\cdot (c+d)= a\cdot(c+d)+b\cdot(c+d)=(a\cdot c+a\cdot d)+(b\cdot c+b\cdot d)$$
and
$$(a+b)\cdot(c+d)=(a+b)\cdot c+(a+b)\cdot d=(a\cdot c+b\cdot c)+(a\cdot d+b\cdot d)\,,$$
whence $$a\cdot c+a\cdot d+b\cdot c+b\cdot d=a\cdot c+b\cdot c+a\cdot d+b\cdot d\,,$$
making
$$a\cdot d+b\cdot c=b\cdot c+a\cdot d\,.$$
In particular, if $N$ is a two-sided nearring which is not a ring, then $N$ cannot have a multiplicative identity (otherwise, $N^{\cdot 2}=N$, making $N$ a ring).
 A: This is the (hopefully) last iteration of this answer. It contains two separate constructions of distributive near-rings, completely answers the original question, and announces my retirement from the topic of near-rings. It's been a long 15 hours.
Section 1 gives some lemmas that allow us to restrict which groups we can use as the base for a non-commutative near-ring. Section 2 gives a construction of a 'degenerate' near-ring. Broadly speaking, one takes a non-commutative ring without identity with base group $H$, and then inflates the multiplication onto any group $G=K\rtimes H$. Although this is definitely a non-commutative distributive near-ring, it somehow feels unsatisfactory. In Section 3 we construct a very different structure, one with no subring, unlike the previous construction. It is a nilpotent near-ring (although such a thing might not be formally defined), where all triple products are zero. Such a structure is necessarily associative, so it suffices to only check distribution. This is a much weaker condition, and allows us significant flexibility in defining the multiplication.

Section 1
Lemma 1: Let $G$ be a finite group, written additively, and suppose that $G$ is the base for a two-sided near-ring. If the multiplication is defined on all pairs $(x,y)$ with $x,y\in S$ a generating set for $G$, then the multiplication is defined on all of $G\times G$.
Proof: Write $g$ and $h$ as words in the elements of $S$. Distributivity means that $gh$ can be written as a sum of $st$, where $s,t\in S$. QED.
Lemma 2: Let $G$ be a finite group, written additively, and suppose that $G$ is the base for a two-sided near-ring. If $x$ and $y$ have coprime additive orders (i.e., orders in $G$) then $xy=0$. More generally, $xy$ has additive order dividing $\gcd(o(x),o(y))$.
Proof: If $o(x)=n$ and $o(y)=m$ then $n\cdot xy=(n\cdot x)y=0y=0$. At the same time $m\cdot xy=x(m\cdot y)=x0=0$. Thus by cancellation $xy=0$ in the coprime case. QED
Lemma 3: Let $G$ be a finite group, written additively, and suppose that $G$ is the base for a two-sided near-ring. If the multiplication is commutative on a generating set for $G$ then the multiplication is commutative on all of $G$.
Proof: I just wrote out $(a_1+a_2)(b_1+b_2)$, swapped the multiplications of the terms, and obtained $(b_1+b_2)(a_1+a_2)$. The general case should follow by induction.
Corollary 4: If $G$ has a generating set consisting of elements of pairwise coprime orders, then $G$ possesses no non-abelian near-ring structure.
The numbers for which there are non-abelian groups at most $27$ are:
$$6,8,10,12,14,16,18,20,21,22,24,26.$$
Corollary 4 eliminates the groups $D_{2n}$ for $n$ odd, and the group $F_{21}$. Thus the orders of the remaining groups are
$$8,12,16,18,24.$$
We cannot do much with $8$ and $16$ with the results above. For $12$, $A_4$ is generated by a $2$ and a $3$, so that's out. $D_{12}$ is still in because I need two even-order elements. The other group, $Q_{12}$ is generated by a $3$ and a $2$. For $18$ we are left with $C_3\times S_3$, which needs with three generators or one of order $6$. For $24$ there are eight non-abelian groups that are not generated by a $2$- and a $3$-element subset.

Section 2
I now provide a construction over $D_{12}$. The remark in the question is helpful, because it left's us narrow down the set of squares. Let $D_{12}$ be viewed as $S_3\times C_2$, so generated by $x,y,z$, with $x$ of order $3$ and $y,z$ of order $2$. By Lemma 2 above, we see that $xy,xz,yx,zx$ are all zero. But also, $yz\neq zy$ as otherwise the multiplication would be commutative. But these have order $2$, so it seems reasonable to assume that the ring spanned by the products has at least two elements of order $2$ in it. This means it has to be Klein four, and so $x^2$, which has to have order $1$ or $3$ in $G$, must be $0$.
This $x$ annihilates the ring, i.e., any product with an $x$ in it is $0$. Thus we construct a non-commutative ring structure on $\langle y,z\rangle$ then we should be able to pull it back to the whole group.
The product operation on $0,y,z,y+z$ is the multiplication of $2\times 2$ matrices over $\mathbb{F}_2$, with the following identification:
$$ 0\mapsto \begin{pmatrix}0&0\\0&0\end{pmatrix},\;y\mapsto \begin{pmatrix}1&0\\0&0\end{pmatrix},\;z\mapsto \begin{pmatrix}0&1\\0&0\end{pmatrix},\;y+z\mapsto \begin{pmatrix}1&1\\0&0\end{pmatrix}.$$
Since this is a non-commutative ring, the ring axioms are satisfied for $\langle y,z\rangle$. But of course, this is just a standard ring, not a near-ring. But because we can pull the multiplication back to all of $G$, the addition now becomes non-commutative.
This does not work on the dihedral group of order $8$ (I checked) because $D_8$ isn't a split extension, so this construction doesn't work.
So the general construction is as follows: Let $R$ be a non-commutative ring (without unity), and let $H$ denote the underlying additive group of $R$. Let $K$ be any finite group, and let $G=K\rtimes H$ be any semidirect product. Define the multiplication on $G$ in the obvious way:
$$ (k_1+h_1)(k_2+h_2)=h_1h_2,$$
where $h_1h_2$ is the ring product of $R$. This is clearly distributive and associative since $R$ is, non-commutative if and only if $R$ is, and has non-commutative addition if and only if the semidirect structure is non-trivial (or $K$ is non-abelian).

Section 3
We now produce a general construction of a distributive near-ring with all triple products zero. Because associativity is the hardest axiom to satisfy in structures, by satisfying it vacuously we make it much easier to build examples.
Let $G\equiv Q_8$ be given by
$$ G=\langle a,b\mid 4a=1, 2a=2b,3b+a+b=3a\rangle.$$
We want to build a near-ring structure on this. Multiplying the relation by $a$ yields
$$ a(3b+a+b)=3a^2,\quad\text{so}\quad a^2=3a^2.$$
Thus, if $z=2a$, $a^2=0$ or $a^2=z$. Since all elements of order $4$ in $G$ look the same (there are automorphisms relating them) we see that this is true for all elements. Finally, $$z^2=(2a)(2a)=4a^2=0$$ and $$za=(a+a)a=2a^2=0$$ (similarly $az=0$). Thus left and right multiplication by $z$ is the zero map, and all squares of elements lie in $\{0,z\}$. Furthermore, because $2a=z=2b$, we see that all products are either $0$ or $z$ because, for example, $2ab=zb=0$.
Thus the near-ring structure is defined by $a^2,b^2,ab,ba$, and each is either $0$ or $z$.
If $a^2=b^2=0$, $ab=ba=z$, we obtain the usual commutator map. If $a^2=b^2=0$, $ab=0$ but $ba=z$, we obtain a new near-ring structure. I checked via Magma that this is left- and right-distributive. But a theoretical check is possible if you prove something like 'if the multiplication is distributive with respect to the relations, then it is distributive in the whole group'. This is because the only issue is when two words in the generators represent the same element of $G$, and this is because of the defining relations. Thus the multiplication is distributive, if it is distributive when you multiply any relation by a generator.
Of course, this may be generalized to a much wider class of groups, I just started with $Q_8$. Since the fact $b^2=z$ was not really used, more that $b^2\in Z(G)$, it should also work over $D_8$. But I haven't tested this, as the question wasn't to develop a complete structure theory for distributive near-rings!
