**From New Scientist #1355, 28th April 1983** [link]

A double number slab is just two rows of squares in a rectangle, with the correct number in each square. The numbers in the top row are just 1, 2, 3, …, *n*. In each bottom row square is written the number of times the number above it occurs in the completed slab.

So, for instance, if *n*=5, you fill in the top row as shown, and in the bottom row you replace *A* by the number of 1’s, *B* by the number of 2’s, …, *E* by the number of 5’s in the whole slab.

Given that *n* is at least 4, can you say:

(a) for what value of *n* is it impossible to complete the slab properly?

(b) for what value of *n* is each second-row number less than or equal to every number to the left of it?

[enigma209]

### Like this:

Like Loading...

*Related*

This Python program runs in 47ms.

Solution:(a) The slab cannot be completed forn=6; (b) Forn=7 the second row is a descending sequence.In general for

n> 6 there is a solution with the bottom row of the form:with (

n– 7) 1’s in the middle.As can be seen all but 4 of the numbers in the bottom row are 1, hence there are

n– 3 1’s overall (as required).There are two 2’s in the bottom row, hence 3 2’s overall.

There is one 3 in the bottom row, hence 2 3’s overall.

Whatever

n– 3 is there is only one of it in the bottom row, hence 2 occurrences overall.The remaining numbers don’t appear in the bottom row, so only appear once in the overall grid.

In case it’s of interest, I found no slabs for n < 4, two for n = 4 (2, 3, 2, 1 and 3, 1, 3, 1), and one for n = 5 (3, 2, 3, 1, 1).