A set of the form {d + Sigma(i) epsilon(i) a : epsilon(i) = 0 or 1, Sigma(i
) epsilon(i) < infinity} (where d is a non-negative integer, a(1), a(2), ..
. are positive integers) is called a Hilbert cube. If {a(1), a(2), ...} is
a finite set of, say, k elements, then it called a k-cube, while if {a(1),
a(2), ...} is infinite, then the cube is said to be an infinite cube. As a
partial answer to a question of Brown, Erdos and Freedman, an upper bound i
s given for the size of a Hilbert cube contained in the set of the squares
not exceeding n. Estimates of Gaussian sums, Gallagher's "large sieves" and
a result of Olson play a crucial rule in the proof. Hilbert cubes in other
special sets are also studied.