Representations of integers as sums of squares