6. (3 points) In space, there is a cube $1000 \times 1000 \times 1000$ with a vertex at the origin and faces parallel to the coordinate planes. Vectors are drawn from the origin to all integer points inside and on the boundary of this cube. Find the remainder when the sum of the squares of the lengths of these vectors is divided by 13.

#
# Answer: 0

Solution:

The sum of the squares of the lengths of these vectors is the sum of the squares of all their coordinates, that is, $3 \cdot 1001^{2} \cdot\left(0^{2}+1^{2}+\right.$ $2^{2}+\ldots+1000^{2}$ ), which is divisible by 13, since 1001 is divisible by 13.