mersenneforum.org a puzzle
 Register FAQ Search Today's Posts Mark Forums Read

 2012-02-20, 22:16 #1 bcp19     Oct 2011 7×97 Posts a puzzle You have 680 glasses and need to build a tower 15 levels high with 1 on top. Is there an equation that can be used to solve for glasses per level?
2012-02-20, 22:21   #2
science_man_88

"Forget I exist"
Jul 2009
Dumbassville

203008 Posts

Quote:
 Originally Posted by bcp19 You have 680 glasses and need to build a tower 15 levels high with 1 on top. Is there an equation that can be used to solve for glasses per level?
only thing that comes to mind is (680-1)/14 =48.5 / level on average.

2012-02-20, 22:37   #3
bcp19

Oct 2011

7·97 Posts

Quote:
 Originally Posted by science_man_88 only thing that comes to mind is (680-1)/14 =48.5 / level on average.
it's more like a pyramid, your design would not be stable.

2012-02-20, 22:41   #4
chalsall
If I May

"Chris Halsall"
Sep 2002

222378 Posts

Quote:
 Originally Posted by bcp19 it's more like a pyramid, your design would not be stable.
You didn't define stability as being a requirement.

2012-02-20, 22:48   #5
bcp19

Oct 2011

7×97 Posts

Quote:
 Originally Posted by chalsall You didn't define stability as being a requirement.
True, but that equation would be simple to figure out, plus how would you have 1 on top and have that .5 per level?

 2012-02-20, 22:50 #6 Dubslow Basketry That Evening!     "Bunslow the Bold" Jun 2011 40 0 ) { for( j=i-1; diff>0; diff-- /* Decrement diff until diff==0 */ ) { // Distribute the difference over each layer if( j<1 ) j = i - 1; // Keep cycling over the pyramid layer[j]++; // Add one to the current layer j--; // Move to the next higher layer } printf("There will be %d layers, as follows:\n", i); for( j=0; j
2012-02-20, 22:53   #7
chalsall
If I May

"Chris Halsall"
Sep 2002

937510 Posts

Quote:
 Originally Posted by bcp19 True, but that equation would be simple to figure out, plus how would you have 1 on top and have that .5 per level?
As I have learnt the hard way... Be very careful what you ask for -- you might just get it....

2012-02-20, 22:53   #8
science_man_88

"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts

Quote:
 Originally Posted by Dubslow Well the sum over the integers up to n := the nth triangular number would describe perfect triangles. So find the highest triangular number <= 680, then distribute the remainder evenly over each layer. In C: Code: int * pyramid(int x) { int i,j,diff; int sum=0; int * layer; for( i=0; sum <= x; i++) sum += i; layer = (int *)malloc(i*sizeof(int)); // Declares an array of size i for( j=0; j0; diff-- /* Decrement diff until diff==0 */ ) { // Distribute the difference over each layer if( j<1 ) j = i - 1; // Keep cycling over the pyramid layer[j]++; // Add one to the current layer j--; // Move to the next higher layer } printf("There will be %d layers, as follows:\n", i); for( j=0; j
Quote:
 Originally Posted by PARI Code: (18:20)>sum(X=1,15,X) %37 = 120`
so it's definitely not a perfect triangle.

2012-02-20, 23:00   #9
bcp19

Oct 2011

7·97 Posts

Quote:
 Originally Posted by science_man_88 so it's definitely not a perfect triangle.
Actually, that may work...
1+3+6+10+15+21+28+36+45+55+66+78+91+105+120=680

yep, that works... I was thinking 15x15,14x14, etc but it went well over 1k.

With the levels now known, without using trial and error, is there an actual equation that would solve this?

Last fiddled with by bcp19 on 2012-02-20 at 23:02

2012-02-20, 23:13   #10
ccorn

Apr 2010

22·37 Posts

Quote:
 Originally Posted by bcp19 You have 680 glasses and need to build a tower 15 levels high with 1 on top. Is there an equation that can be used to solve for glasses per level?
It's a pyramid with triangles at each level, each triangle packed regularly with glasses in the (2-dimensional) densest possible way, one glass at the top, and each non-top level having its side length one glass longer than the previous (higher) level.

Numbering the levels beginning with 1 at the top, the glass count for level i is the triangular number T(i) = i*(i+1)/2.
The total glass count V(n) for n levels is then
$V(n) = \sum_{i=1}^n \frac{i\,(i+1)}{2} = \frac{1}{2}\left(\left(\sum_{i=1}^n i^2\right)+\left(\sum_{i=1}^n i\right)\right) = \frac{1}{2}\left(\frac{n\,(n+1)\,(2n+1)}{6}+\frac{n\,(n+1)}{2}\right) = \frac{n\,(n+1)(n+2)}{6}$.
And indeed V(15) = 680.

Edit: OK, folks, you have been faster.

Last fiddled with by ccorn on 2012-02-20 at 23:16

2012-02-20, 23:21   #11
kar_bon

Mar 2006
Germany

23×3×7×17 Posts

Quote:
 Originally Posted by bcp19 With the levels now known, without using trial and error, is there an actual equation that would solve this?
Every level n is the sum of all numbers from 1 to n.

So:

FOR level = 1 to 15
number of glasses = $\sum_{i=1}^{level}i$

 Similar Threads Thread Thread Starter Forum Replies Last Post Harrywill Puzzles 4 2017-05-03 05:10 Uncwilly Puzzles 75 2012-06-12 13:42 henryzz Puzzles 4 2007-09-23 07:31 nibble4bits Puzzles 37 2006-02-27 09:35 Orgasmic Troll Puzzles 6 2005-12-08 07:19

All times are UTC. The time now is 01:59.

Thu Dec 3 01:59:12 UTC 2020 up 83 days, 23:10, 1 user, load averages: 2.07, 2.35, 2.21