* Problem:* Consider the set of point

S = { (x,y) : x,y are non-negative integers }.

Find the number of squares that can be formed with vertices belonging to S and sides parallel to the axes.

*: S = {(x,y) : x,y are non-negative integers }*

**Solution**We calculate number of squares by calculating number of |x| squares ,& number of squares number of squares.

Now number of |x| squares = number of choosing one pair of lines with difference 1 parallel to x axis & integer distance x number of choosing one pair of lines to y axis with distance 1 & integer distance from y axis = =

Similarly number of squares

=

So total number of squares

= =