We know that if $n = 2$ then the operation is called a binary operation.
$ \circ $ on set $X$ is a function $\circ : X \times X \rightarrow X$.
And the number of all associative binary operation on a finite set $X=\{1, 2\}$
with $|X|=2$ cardinality, is 8.
They are:
$$1)
\begin{array}{c|ccccc}
\circ & & \\ \hline
& 1& 1& \\
& 1& 1&
\end{array}
2)
\begin{array}{c|ccccc}
\circ & & \\ \hline
& 1& 1& \\
& 1& 2&
\end{array}
3)
\begin{array}{c|ccccc}
\circ & & \\ \hline
& 1& 1& \\
& 2& 2&
\end{array}
4)
\begin{array}{c|ccccc}
\circ & & \\ \hline
& 1& 2& \\
& 1& 2&
\end{array}$$
$$5)
\begin{array}{c|ccccc}
\circ & & \\ \hline
& 2& 1& \\
& 1& 2&
\end{array}
6)
\begin{array}{c|ccccc}
\circ & & \\ \hline
& 1& 2& \\
& 2& 1&
\end{array}
7)
\begin{array}{c|ccccc}
\circ & & \\ \hline
& 1& 2& \\
& 2& 2&
\end{array}
8)
\begin{array}{c|ccccc}
\circ & & \\ \hline
& 2& 2& \\
& 2& 2&
\end{array}
$$
$$1,2 \in \mathbb X$$
Also I made a program which counts associative operations when $n=3$, I mean it counts ternary associative operations based on this condition:
$a \circ b \circ (c \circ d \circ e) = a \circ (b \circ c \circ d) \circ e = (a \circ b \circ c) \circ d \circ e$
Where $ \circ $ on set $X$ is a function $\circ : X \times X \times X \rightarrow X$.
Also $a,b,c,d,e \in \mathbb X$ and when cardinality equals $|X|=2$ .I mean when $X=\{1, 2\}$ it showed me only 8 associative operations. They are:
$$1) \begin{array}{c|ccccc} \circ & & & & \\ \hline & & 1& & 1& \\ & 1& & 1& \\ & & 1& & 1& \\ & 1& & 1& \end{array} 2) \begin{array}{c|ccccc} \circ & & & & \\ \hline & & 1& & 1& \\ & 1& & 1& \\ & & 1& & 2& \\ & 1& & 1& \end{array} 3) \begin{array}{c|ccccc} \circ & & & & \\ \hline & & 2& & 2& \\ & 1& & 1& \\ & & 2& & 2& \\ & 1& & 1& \end{array} 4) \begin{array}{c|ccccc} \circ & & & & \\ \hline & & 1& & 2& \\ & 1& & 2& \\ & & 1& & 2& \\ & 1& & 2& \end{array} $$ $$5) \begin{array}{c|ccccc} \circ & & & & \\ \hline & & 2& & 1& \\ & 1& & 2& \\ & & 1& & 2& \\ & 2& & 1& \end{array} 6) \begin{array}{c|ccccc} \circ & & & & \\ \hline & & 2& & 2& \\ & 1& & 2& \\ & & 2& & 2& \\ & 2& & 2& \end{array} 7) \begin{array}{c|ccccc} \circ & & & & \\ \hline & & 1& & 2& \\ & 2& & 1& \\ & & 2& & 1& \\ & 1& & 2& \end{array} 8) \begin{array}{c|ccccc} \circ & & & & \\ \hline & & 2& & 2& \\ & 2& & 2& \\ & & 2& & 2& \\ & 2& & 2& \end{array} $$ So in this case I wrote result from arguments of a ternary operations in a cubic matrices as called in a tensors.
Things will get even more difficult when $n = 4$.
I wrote such a program also based on this condition:
$$a \circ b \circ c \circ (d \circ e \circ f \circ g) = a \circ b \circ (c \circ d \circ e \circ f) \circ g = a \circ (b \circ c \circ d \circ e) \circ f \circ g = (a \circ b \circ c \circ d) \circ e \circ f \circ g$$
Where $ \circ $ on set $X$ is a function $\circ : X \times X \times X \times X \rightarrow X$.
Also $a,b,c,d,e,f,g \in \mathbb X$ and when cardinality equals $|X|=2$ .I mean when $X=\{1, 2\}$ it showed me only 8 associative operations. They are:
$$1) \begin{array}{c|ccccc} \circ & & & & & & & & \\ \hline & & 1& & & & & & & & & & 1& \\ & 1& & & & & & & & & & 1& \\ & & & & & & 1& & 1& \\ & & & & & 1& & 1& \\ & & & & & & 1& & 1& \\ & & & & & 1& & 1& \\ & & 1& & & & & & & & & & 1& \\ & 1& & & & & & & & & & 1& \\ \end{array} 2) \begin{array}{c|ccccc} \circ & & & & & & & & \\ \hline & & 1& & & & & & & & & & 1& \\ & 1& & & & & & & & & & 1& \\ & & & & & & 1& & 1& \\ & & & & & 1& & 1& \\ & & & & & & 1& & 2& \\ & & & & & 1& & 1& \\ & & 1& & & & & & & & & & 1& \\ & 1& & & & & & & & & & 1& \\ \end{array} $$
.............................................................................................................................................................
$$3) \begin{array}{c|ccccc} \circ & & & & & & & & \\ \hline & & 1& & & & & & & & & & 1& \\ & 1& & & & & & & & & & 1& \\ & & & & & & 2& & 2& \\ & & & & & 2& & 2& \\ & & & & & & 2& & 2& \\ & & & & & 2& & 2& \\ & & 1& & & & & & & & & & 1& \\ & 1& & & & & & & & & & 1& \\ \end{array} 4) \begin{array}{c|ccccc} \circ & & & & & & & & \\ \hline & & 1& & & & & & & & & & 2& \\ & 1& & & & & & & & & & 2& \\ & & & & & & 1& & 2& \\ & & & & & 1& & 2& \\ & & & & & & 1& & 2& \\ & & & & & 1& & 2& \\ & & 1& & & & & & & & & & 2& \\ & 1& & & & & & & & & & 2& \\ \end{array}$$
.............................................................................................................................................................
$$5)
\begin{array}{c|ccccc}
\circ & & & & & & & & \\ \hline
& & 2& & & & & & & & & & 1& \\
& 1& & & & & & & & & & 2& \\
& & & & & & 1& & 2& \\
& & & & & 2& & 1& \\
& & & & & & 2& & 1& \\
& & & & & 1& & 2& \\
& & 1& & & & & & & & & & 2& \\
& 2& & & & & & & & & & 1& \\
\end{array}
6)
\begin{array}{c|ccccc}
\circ & & & & & & & & \\ \hline
& & 2& & & & & & & & & & 2& \\
& 1& & & & & & & & & & 2& \\
& & & & & & 2& & 2& \\
& & & & & 2& & 2& \\
& & & & & & 2& & 2& \\
& & & & & 2& & 2& \\
& & 2& & & & & & & & & & 2& \\
& 2& & & & & & & & & & 2& \\
\end{array} $$
.............................................................................................................................................................
$$7) \begin{array}{c|ccccc} \circ & & & & & & & & \\ \hline & & 1& & & & & & & & & & 2& \\ & 2& & & & & & & & & & 1& \\ & & & & & & 2& & 1& \\ & & & & & 1& & 2& \\ & & & & & & 1& & 2& \\ & & & & & 2& & 1& \\ & & 2& & & & & & & & & & 1& \\ & 1& & & & & & & & & & 2& \\ \end{array} 8) \begin{array}{c|ccccc} \circ & & & & & & & & \\ \hline & & 2& & & & & & & & & & 2& \\ & 2& & & & & & & & & & 2& \\ & & & & & & 2& & 2& \\ & & & & & 2& & 2& \\ & & & & & & 2& & 2& \\ & & & & & 2& & 2& \\ & & 2& & & & & & & & & & 2& \\ & 2& & & & & & & & & & 2& \\ \end{array} $$
So in this case I wrote result from arguments of operations in a Hypercube as called in a "Tesseract" in order to see it more easily.
I did not tried it when $n = 5$ because we will have $2^{(2^5)} = 4294967296 $ algebraic operations and to check it`s associative property it takes a long time!
Will it be again 8 if $n = 5$?
So my question is: If this my program tells me true, then how to prove it using only math, I mean without programming, that the number of all associative $n$-ary algebraic operations on a finite set with 2 cardinality will be always 8?