Why a particular ring of integers is not generated by a single element It says here in the Sage documentation that the ring of integers in the number field obtained from
$$f(x) = x^3 + x^2 - 2x + 8$$
is not generated by a single element.  How would one go about showing that this is the case?

Let $\alpha$ be a root of $f(x) = x^{3} + x^{2} - 2x + 8$.  We will show that $\mathcal{O}_{K} = \mathbb{Z}[\alpha, \beta]$, where $\beta = (\alpha + \alpha^{2})/2$.  Granting this, assume that $\mathbb{Z}[\vartheta]$ for some $\vartheta = a + b\alpha + c\beta$.  Since $\{1, \vartheta, \vartheta^{2}\}$ is an integral basis iff $\{1, (\vartheta + 1), (\vartheta + 1)^{2}\}$ is an integral basis iff $\{1, (\vartheta - a), (\vartheta - a)^{2}\}$ is an integral basis, we may assume that $a = 0$.  We find that (writing $\alpha^{2}, \alpha\beta, \beta^{2}$ in terms of $\alpha, \beta$)
$$(b\alpha + c\beta)^{2} = -8bc - 6c^{2} + \left(2bc - b^{2} - \frac{c^{2}}{2}\right)\alpha - 2b^{2}\beta,$$
so that the change of basis matrix is given by
$$A = \begin{bmatrix}
1 & 0 & -8bc - 6c^{2}\\
0 & b & 2bc - b^{2} - \frac{c^{2}}{2}\\
0 & c & -2b^{2}
\end{bmatrix}.$$
If $\mathbb{Z}[\vartheta]$ is indeed an integral basis, then this matrix must have determinant $\pm 1$.  As
$$\pm 1 = \det A = -2b^{3} - 2bc^{2} + b^{2}c + \frac{c^{3}}{2},$$
we must have $c$ even.  But then the determinant is even, a contradiction, so that no such $\vartheta$ exists.
We now show that $\mathcal{O}_{K} = \mathbb{Z}[\alpha, \beta]$.  Note that the linear transformation of multiplication by $a + b\alpha + c\alpha^{2}$ is given by
$$L = \begin{bmatrix}
a & -8c & -8(b - c)\\
b & 2c + a & 2b - 10c\\
c & b - c & a - b + 3c
\end{bmatrix}.$$
Consider $\mathcal{O} = \mathbb{Z}[\alpha]$.  First, $f$ is indeed the minimal polynomial since it is irreducible mod 3 (no roots).  Then the discriminant of $\{1, \alpha, \alpha^{2}\}$ is
$$d(1, \alpha, \alpha^{2}) = -N\Big(f'(\alpha)\Big) = -N(3\alpha^{2} + 2\alpha - 2) = -\rm{det}\begin{bmatrix}
-2 & -24 & 8\\
2 & 4 & -26\\
3 & -1 & 7
\end{bmatrix} = -4 \cdot 523.$$
As a result, since $2^{2} \mid d$, if $\mathcal{O}_{K} \not= \mathcal{O}$, (by a theorem) there exists an algebraic integer of the form
$$\frac{1}{2}(\lambda_{1} + \lambda_{2}\alpha + \lambda_{3}\alpha^{2}),$$
where $\lambda_{i} \in \{0, 1\}$.
If such an algebraic integer $\gamma$ of this form exists, we have
$$\rm{Tr}\, \gamma = \rm{tr}\, L = \frac{3\lambda_{1} - \lambda_{2} + 5\lambda_{3}}{2} \in \mathbb{Z}.$$
Examining the parity of the numberator, we see that for $\gamma \not= 0$, we must have exactly two $\lambda_{i} = 1$.  Thus, the possibilities for $\gamma$ are
$$\frac{1 + \alpha}{2}, \frac{1 + \alpha^{2}}{2}, \frac{\alpha + \alpha^{2}}{2}.$$
However, for the first two possibilities,
$$N(\gamma) = \rm{det} \begin{bmatrix}
\frac{1}{2} & 0 & -4\\
\frac{1}{2} & \frac{1}{2} & 1\\
0 & \frac{1}{2} & 0
\end{bmatrix} = -\frac{5}{4} \notin \mathbb{Z}, \qquad N(\gamma) = \rm{det} \begin{bmatrix}
\frac{1}{2} & -2 & 4\\
0 & \frac{3}{2} & -5\\
\frac{1}{2} & -\frac{1}{2} & 2
\end{bmatrix} = \frac{9}{4} \notin \mathbb{Z}.$$
For the third possibility, which we denoted $\beta$ earlier, the norm is indeed an integer and we further find (upon examining $\beta, \beta^{2}, \beta^{3}$) that
$$\beta^{3} - \beta^{2} + 6\beta - 8 = 0,$$
so that $\beta \in \mathbb{O}_{K}$ and $\mathbb{Z}[\alpha, \beta] \in \mathcal{O}_{K}$.  
Now, $\mathbb{Q} \oplus \mathbb{Q}\alpha \oplus \mathbb{Q}\alpha^{2} \approx \mathbb{Q} \oplus \mathbb{Q}\alpha \oplus \mathbb{Q}\beta$ and we have a change of basis matrix ($\{1, \alpha, \alpha^{2}\} \rightarrow \{1, \alpha, \beta\}$)
$$B = \begin{bmatrix}
1 & 0 & 0\\
0 & 1 & -1\\
0 & 0 & 2
\end{bmatrix}, \qquad \rm{det} B = 2.$$
Hence, $d(1, \alpha, \beta) = d(1, \alpha, \alpha^{2})/2^{2} = 523$.  Since $523$ is squarefree, $\{1, \alpha, \beta\}$ is a basis for $\mathcal{O}_{K}$.
