15,121,851 members

# Welcome to the Lounge

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 Re: IQ / Programming Quiz (Cannon-Ball Stacks) AspDotNetDev25-Jan-12 9:03 AspDotNetDev 25-Jan-12 9:03
 Re: IQ / Programming Quiz (Cannon-Ball Stacks) Stephen Dycus25-Jan-12 9:10 Stephen Dycus 25-Jan-12 9:10
 Re: IQ / Programming Quiz (Cannon-Ball Stacks) YvesDaoust25-Jan-12 8:02 YvesDaoust 25-Jan-12 8:02
 Re: IQ / Programming Quiz (Cannon-Ball Stacks) Member 771612725-Jan-12 10:32 Member 7716127 25-Jan-12 10:32
 Re: IQ / Programming Quiz (Cannon-Ball Stacks) Leng Vang25-Jan-12 10:34 Leng Vang 25-Jan-12 10:34
 Re: IQ / Programming Quiz (Cannon-Ball Stacks) YvesDaoust25-Jan-12 12:19 YvesDaoust 25-Jan-12 12:19
 Re: IQ / Programming Quiz (Cannon-Ball Stacks) YvesDaoust25-Jan-12 13:08 YvesDaoust 25-Jan-12 13:08
 Re: IQ / Programming Quiz (Cannon-Ball Stacks) Ronald M. Martin25-Jan-12 18:49 Ronald M. Martin 25-Jan-12 18:49
 I used a spreadsheet constructed as follows: A1 = 2 A2 = 1 B1 = =IF(B1=1,A1+1,A1) B2 = =IF(B1=1,A2-1,B1-1) Then I dragged B1 and B2 downward to create a list of all the combinations of all the base sizes I wanted to examine. In my case, I chose to stop at line 2016 with column A at 64 and column B at 1. C1 = =A1*(A1+1)*(A1+3)/6 I dragged C1 to D1. E1 = =C1+D1 I dragged C1, D1 and E1 to line 2016. I looked at the line that started with 64 and 63 to determine the maximum sum I could generate from the data I was using. Then I extended the table as follows: A2017 = 1 E2017 = =A2017*(A2017+1)*(A2017+3)/6 I dragged A2017 through E2017 down until the entry in column E was as large as possible but still less than or equal to the largest sum in the upper part of the table. I added column F with 1's in the upper portion of the table and 0's in the lower portion of the table to distinguish the two types of entries. I copied just the values from the table to a new sheet. I sorted the new table using column E as the primary key and column F as the secondary key. I added conditional formatting to column E from row 2 down to change the background color of each cell to red if its value was the same as that of the cell above it. When I realized that my red cells included both cases where there were two sets of two different-sized tetrahedra that contained the same number of cannonballs and the desired cases where the cannonballs from two different-sized tetrahedra can be combined to make a larger tetrahedron, I added another column that contained 1 on the same condition that colored the red cells and 0 when those cells would be while. I then conditionally colored this column from row 2 down so that it was green if the row above contained a zero in column F. I did it this way because I couldn't create a more complex condition with the existing conditional coloring mechanism. The answers that others have posted have already covered the three solutions that I found this way. The question answered by the red cells is interesting in and of itself. It leads to other questions such as: "Are there any numbers of cannonballs that can be stacked into two tetrahedra more than two ways?" and "Are there any cannonball tetrahedra that can be decompsed into two tetrahedra two or more ways?" Questions of this type remind me of Goldbach's Conjecture that every even number greater than 2 can be expressed as the sum of two odd primes. That was the subject of one of the first programs I wrote in 1961. The conjecture has never been proven or disproven.
 Re: IQ / Programming Quiz (Cannon-Ball Stacks) AspDotNetDev25-Jan-12 19:05 AspDotNetDev 25-Jan-12 19:05
 Re: IQ / Programming Quiz (Cannon-Ball Stacks) Ronald M. Martin25-Jan-12 20:14 Ronald M. Martin 25-Jan-12 20:14
 Re: IQ / Programming Quiz (Cannon-Ball Stacks) AspDotNetDev25-Jan-12 20:32 AspDotNetDev 25-Jan-12 20:32
 Goldbach's Conjecture modified for practical use jsc4226-Jan-12 0:33 jsc42 26-Jan-12 0:33
 How's your geometry? charlieg23-Jan-12 15:39 charlieg 23-Jan-12 15:39
 Re: How's your geometry? _Maxxx_23-Jan-12 15:45 _Maxxx_ 23-Jan-12 15:45
 Re: How's your geometry? charlieg23-Jan-12 15:57 charlieg 23-Jan-12 15:57
 Re: How's your geometry? _Maxxx_23-Jan-12 16:09 _Maxxx_ 23-Jan-12 16:09
 Re: How's your geometry? charlieg23-Jan-12 16:22 charlieg 23-Jan-12 16:22
 Re: How's your geometry? _Maxxx_23-Jan-12 16:32 _Maxxx_ 23-Jan-12 16:32
 Re: How's your geometry? charlieg23-Jan-12 15:57 charlieg 23-Jan-12 15:57
 Re: How's your geometry? _Maxxx_23-Jan-12 16:11 _Maxxx_ 23-Jan-12 16:11
 Re: How's your geometry? charlieg23-Jan-12 16:16 charlieg 23-Jan-12 16:16
 Re: How's your geometry? charlieg23-Jan-12 16:17 charlieg 23-Jan-12 16:17
 Re: How's your geometry? charlieg23-Jan-12 16:12 charlieg 23-Jan-12 16:12
 Re: How's your geometry? _Maxxx_23-Jan-12 16:29 _Maxxx_ 23-Jan-12 16:29
 Re: How's your geometry? charlieg24-Jan-12 2:23 charlieg 24-Jan-12 2:23
 Last Visit: 31-Dec-99 19:00     Last Update: 5-Dec-21 2:16 Refresh ᐊ Prev1...25468254692547025471254722547325474254752547625477 Next ᐅ