But That's so Huge?

Count the number of squares present in a grid of 1024 × 1024 1024 \times 1024 squares.


The answer is 358438400.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Arpit MIshra
Sep 23, 2015

If you count the number of squares in a 1 × 1 1 \times 1 square grid it is equal to 1 1 , which is equal to 1 2 1^2 .

If you count the number of squares in a 2 × 2 2 \times 2 square grid it is equal to 5 5 , which is equal to 1 2 + 2 2 1^2 + 2^2 .

If you count the number of squares in a 3 × 3 3 \times 3 square grid it is equal to 15 15 , which is equal to 1 2 + 2 2 + 3 2 1^2 + 2^2 + 3^2 .

If we follow this sequence we see that the number of squares in a n × n n \times n grid of squares is equal to:

1 2 + 2 2 + 3 2 + 4 2 + + n 2 1^2 + 2^2 + 3^2 + 4^2 +\ldots + n^2 = i = 1 n i 2 \displaystyle \sum_{i=1}^n i^2 = n ( n + 1 ) ( 2 n + 1 ) 6 \huge\frac {n(n+1)(2n+1)}{6} .

  • Therefore the number of squares in a 1024 × 1024 1024 \times 1024 grid is:

1 2 + 2 2 + 3 2 + 4 2 + + 102 4 2 1^2 + 2^2 + 3^2 + 4^2 +\ldots + 1024^2 = i = 1 1024 i 2 \displaystyle \sum_{i=1}^{1024} i^2 = 1024 ( 1024 + 1 ) ( 2 ( 1024 ) + 1 ) ) 6 \huge\frac {1024(1024+1)(2(1024)+1))}{6} .

= 1024 × 1025 × 2049 6 \huge\frac{1024 \times 1025 \times 2049}{6}

= 358438400 \LARGE\boxed{\color{#20A900}{358438400}} .

Ariella Lee
Dec 8, 2015

We must count the number of 1 × 1 1\times1 , 2 × 2 2\times2 , \cdots , and 1024 × 1024 1024\times1024 squares. That's a lot of squares, so we should try to come up with a generalization to count the number of squares in an n × n n\times n grid.

Start by counting the number of 1 × 1 1\times1 squares. There are n n columns of width 1 1 and within each of these columns, there are n n different rows of width 1 1 , so the number of 1 × 1 1\times1 squares is n × n = n 2 n\times n=n^{2} .

Then count the number of 2 × 2 2\times2 squares. There are n 1 n-1 columns of width 2 2 and within each of these, there are also n 1 n-1 rows of width 2 2 . Each 2 × 2 2\times2 square is made from one of the n 1 n-1 columns of width 2 2 and one of the n 1 n-1 rows of width 2 2 . So, there are ( n 1 ) × ( n 1 ) = ( n 1 ) 2 (n-1)\times (n-1)=(n-1)^{2} squares of width 2 2 .

Continuing the pattern, you have that the number of ( n 1 ) × ( n 1 ) (n-1)\times(n-1) squares is ( n ( n 2 ) ) × ( n ( n 2 ) ) = 2 2 (n-(n-2))\times (n-(n-2))=2^{2} , and the number of n × n n\times n squares is 1 2 1^{2} .

Summing up the number of squares, you get: n 2 + ( n 1 ) 2 + + 2 2 + 1 2 = k = 1 n k 2 . n^{2}+(n-1)^{2}+\cdots+2^{2}+1^{2}= \sum_{k=1}^{n}k^{2}. In this case, n = 1024 n=1024 , so I computed k = 1 1024 k 2 \sum_{k=1}^{1024}k^{2} with Wolframalpha and got 358.438.400 \boxed{358.438.400} .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...