(computed by repeated multiplying modulo $p$).
The table consists of $m := \lceil \sqrt{p-1}\,\rceil$ entries from 0 to $m-1$.
In the next step, one computes $g^{-m}\pmod p$. Initialize an index $i$ with zero.
-If $a_i$ happens to coincide with some $t_j$ where $0\leq j\leq m-1$, then the
+If $a_i$ happens to coincide with some $t_j$ where $0\leq j\leq m-1$, then the
algorithm terminates with $x=i\cdot m + j$, otherwise it computes $a_{i+1} = a_i g^{-m}\pmod p$.
An implementation of this algorithm in \CC\, might be written as follows:
{\tiny \lstinputlisting{../src/discrete_log.cpp}}
\item The first argument is the characteristic of the finite field, which is a prime.
Below 10, the primes are 2,3,5,7. Obviously, for $p=2$ we have no elements of
order $p-1$;
- \item The condition that $g$ has to be of order $p-1$ is a major restriction.
+ \item The condition that $g$ has to be of order $p-1$ is a major restriction.
The only elements that satisfy this are given by
\end{itemize}
\begin{center}
3 & 2 \\
5 & 2,3\\
7 & 3,5\\
-\hline
-\end{tabular}
+\hline
+\end{tabular}
\end{center}
\begin{itemize}
\item The element $a$ has obviously to be non-zero in $\mathbb{Z}_p$.
$(p,g,a)$\\
\hline
$(3,2,1)$, $(3,2,2)$\\
-$(5,2,1)$,$(5,2,2)$,$(5,2,3)$,$(5,2,4)$\\
+$(5,2,1)$,$(5,2,2)$,$(5,2,3)$,$(5,2,4)$\\
$(5,3,1)$, $(5,3,2)$, $(5,3,3)$, $(5,3,4)$\\
$(7,3,1)$, $(7,3,2)$, $(7,3,3)$, $(7,3,4)$, $(7,3,5)$, $(7,3,6)$ \\
-$(7,5,1)$, $(7,5,2)$, $(7,5,3)$, $(7,5,4)$, $(7,5,5)$, $(7,5,6)$
-\end{tabular}
+$(7,5,1)$, $(7,5,2)$, $(7,5,3)$, $(7,5,4)$, $(7,5,5)$, $(7,5,6)$
+\end{tabular}
\end{center}
which gives a total of 22 elements to check.
+
+\subsection{Prime Number Generation}
+A classic algorithm for generating prime-numbers less equal a given number, is the Sieve of Erathostenes.
+Suppose, we want to produce a list of all primes less equal $m$, the algorithm proceeds by enumerating
+all integers from 2 to $m$, we set $S^{(0)}:=\{2,\ldots,m\}$. The first prime, is obviously given by 2, i.e.
+the minimal element of the set $S^{(0)}$. Of course, any number greater and divisible by 2 is not prime,
+hence, we remove the \emph{even} elements from the set $S^{(0)}$ to obtain the set $S^{(1)}$. The next prime
+number is the least number of the updated set $S^{(1)}$, i.e. 3. We remove all multiples of 3 to obtain
+$S^{(2)}$. Proceedings likewise, up to $\sqrt{m}$, by selecting the minimal element $p$ (which is prime)
+of $S^{(k)}$ and updating $S^{(k)}$ to $S^{(k+1)}$, that is, removing all multiples of $p$, we obtain a list
+of primes less equal $m$.\\
+
+We formalize this algorithm in two ways. While the first formalization treats the numbers 2..$m$ as boolean
+array, we can for the second formalization the data structure of sets (that corresponds to sets in the
+mathematical sense). Obviously, we should obtain the same results.
+
+\subsection*{The RISCAL Formalization}
+{\scriptsize \verbatimboxed{../sieveEratosthenes.txt}}
+
+
\appendix