PDA

View Full Version : Easier way to find how many squares are in a (grided) square



Teddybear
2016-08-11, 04:15 PM
Okay so im wondering if there is an easier way to find how many squares are in a (grided) square. I know you square ( n^2) the number of how big the square is then count back from the number you start with and square them until you get to 1. EX. A square that is 10×10 you would go 10^2=100 9^2=81 8^2=64 7....2^2=4 1^2=1 then you add them all up (which ends up being 385) but it takes a bit and i was wondering if there is a way i could use the Triangular number equation (which is n(n+1)/2 ) and add in the squares to the equation since you have to add (ex number) 10 through 1 together, but the numbers need to be 10-1 squared.

Randomguy
2016-08-11, 04:36 PM
The formula for the sum of n squares is n*(n+1)*(2n+1)/6. Here's a proof (http://pirate.shu.edu/~wachsmut/ira/infinity/answers/sm_sq_cb.html).

Teddybear
2016-08-11, 04:44 PM
Thank you. I will have to test this out

OldTrees1
2016-08-12, 09:10 AM
If you take a look at Pascal's Triangle you might notice both the Triangle and Tetrahedral numbers in their respective diagonals. If you recall how to use the binomial theorem to calculate a particular value in Pascal's Triangle then you can derive the formulas for the Triangle, Tetrahedral, etc sequences.

gomipile
2016-08-12, 06:53 PM
If you take a look at Pascal's Triangle you might notice both the Triangle and Tetrahedral numbers in their respective diagonals. If you recall how to use the binomial theorem to calculate a particular value in Pascal's Triangle then you can derive the formulas for the Triangle, Tetrahedral, etc sequences.

That is true, but the OP was talking about the square pyramidal numbers, which don't form a line in Pascal's triangle. The third square pyramidal number is 14, which is not present anywhere in Pascal's triangle.

You can get the square pyramidal numbers as a linear combination of two diagonals of Pascal's triangle, but it's not just a simple reading off of the triangle.

OldTrees1
2016-08-15, 12:00 PM
That is true, but the OP was talking about the square pyramidal numbers, which don't form a line in Pascal's triangle. The third square pyramidal number is 14, which is not present anywhere in Pascal's triangle.

You can get the square pyramidal numbers as a linear combination of two diagonals of Pascal's triangle, but it's not just a simple reading off of the triangle.

I was giving a general solution for deriving these formulas. The square pyramidal numbers can be derived from the tetrahedral numbers since each element of a tetrahedral numbers varies by a triangle number which is comparable to a square.


However I was not sufficiently clear so, thank you for clarifying that the tetrahedral numbers are not the square pyramid numbers.