  It is known that the spectrum of the Laplace operator on functions of a
closed Riemannian manifold does not determine the integrals of the individual
fourth order curvature invariants $\operatorname{scal}^2$,
$|\operatorname{ric}|^2$, $|R|^2$, which appear as summands in the second heat
invariant $a_2$. We study the analogous question for the integrals of the sixth
order curvature invariants appearing as summands in $a_3$. Our result is that
none of them is determined individually by the spectrum, which can be shown
using various examples. In particular, we prove that two isospectral
nilmanifolds of Heisenberg type with three-dimensional center are locally
isometric if and only if they have the same value of $|\nabla R|^2$. In
contrast, any pair of isospectral nilmanifolds of Heisenberg type with centers
of dimension $r>3$ does not differ in any curvature invariant of order six,
actually not in any curvature invariant of order smaller than $2r$. We also
prove that this implies that for any $k\in\Bbb N$, there exist locally
homogeneous manifolds which are not curvature equivalent but do not differ in
any curvature invariant of order up to $2k$.
