  For d-dimensional irrational ellipsoids E with d >= 9 we show that the number
of lattice points in rE is approximated by the volume of rE, as r tends to
infinity, up to an error of order o(r^{d-2}). The estimate refines an earlier
authors' bound of order O(r^{d-2}) which holds for arbitrary ellipsoids, and is
optimal for rational ellipsoids. As an application we prove a conjecture of
Davenport and Lewis that the gaps between successive values, say s<n(s), s,n(s)
in Q[Z^d], of a positive definite irrational quadratic form Q[x], x in R^d, are
shrinking, i.e., that n(s) - s -> 0 as s -> \infty, for d >= 9. For comparison
note that sup_s (n(s)-s) < \infty and \inf_s (n(s)-s) >0, for rational Q[x] and
d>= 5. As a corollary we derive Oppenheim's conjecture for indefinite
irrational quadratic forms, i.e., the set Q[Z^d] is dense in R, for d >= 9,
which was proved for d >= 3 by G. Margulis in 1986 using other methods.
Finally, we provide explicit bounds for errors in terms of certain
characteristics of trigonometric sums.
