I am not fully sure but according to my calculations they are respectively equal to the sum of first \(n\) squares and the sum of first \(n\) cubes. Or we can say that there are \(\frac{n(n+1)(2n+1)}{6}\) squares and \((\frac{(n)(n+1)}{2})^2\) rectangles in an \(n*n\) grid.

## Comments

Sort by:

TopNewestI am not fully sure but according to my calculations they are respectively equal to the sum of first \(n\) squares and the sum of first \(n\) cubes. Or we can say that there are \(\frac{n(n+1)(2n+1)}{6}\) squares and \((\frac{(n)(n+1)}{2})^2\) rectangles in an \(n*n\) grid.

Log in to reply