### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,149)
- misc (2)
- project euler (2)
- puzzle (38)
- site news (44)
- tantalizer (40)
- teaser (3)

### Site Stats

- 175,242 hits

Advertisements

Programming Enigma Puzzles

19 January 2015

Posted by on **From New Scientist #2418, 25th October 2003** [link]

George asked his son to imagine a 3 × 4 rectangle marked off in unit squares.

“Following the gridlines, how many rectangles (including squares) of all possible sizes, positions and orientations can you see?”

“Sixty.”

“Correct. Now imagine a 2 × 3 × 4 brick marked off internally into unit cubes. Following the grid markings, how many cuboids of all possible sizes, positions and orientations can you see?”

“One hundred and eighty!”

“Right again. Now imagine I have a larger brick of integer dimensions for which the number of embedded cuboids is 105105.”

“Er, yes.”

“What are the dimensions of the brick?”

[enigma1262]

Advertisements

%d bloggers like this:

If we consider an n dimensional shape, that has s sub-shapes. If we then use it to generate an (n+1)-dimensional shape, we see that if the extra dimension is of size 1 then there are also s sub-shapes of the the (n+1)-dimensional shape. If the extra dimension is of size 2 then there are s sub-shapes with size 2 in the new dimension and 2s sub-shapes with size 1 in the new dimension, giving 3s sub-shapes overall. Following this reasoning we see that if we add a new dimension to the original shape with size k, then we end up with T(k)s sub-shapes of the (n+1) dimensional shape. (If maybe easier to see this if you consider going from 1-dimension to 2-dimensions, or 2-dimensions to 3-dimensions).

So in general the number of sub-shapes of an n-dimensional shape is the product of the triangular numbers that measure each dimension, and in particular for 3-dimensional blocks with dimensions of

x,yandz, the number of sub-blocks is:And this fits with the examples given:

This Python program finds the

x,y,zdimensions of a block consisting of 105105 sub-blocks in 33msSolution:The dimensions of the block are 6 × 10 × 13.To solve the problem manually we see that we want:

Re-writing the product as the product of thee adjacent pairs of integers:

hence:

x=6,y=10,z=13.