calculates the square of a number as a series of differences of squares.