# Cubes with common faces

A cube n × n × n is formed by $$n ^ 3$$ unitary cubes and initially has a red cube in only one of its vertices. We number this cube with the number 1. Every day from day 2, neighboring cubes (cubes with common faces) to red cubes also turn red and are numbered with the day number.

For example, the cube 2 × 2 × 2 above, on the first day, has a red cube with the number 1, on the second day has four red cubes, one with the number 1 and three with the number 2, on the third day has seven , a cube with the number 1, three with the number 2 and three with the number 3, and only on the fourth day will have all their little cubes in red color. To represent the final numbering we can use n trays representing each n of the cube layers viewed from the front. For example, for the 2 × 2 × 2 cube above we have the following layers:

a) In the following figure we have the four layers of the 4 × 4 × 4 cube and the cubes numbered 1 and 2. Copy these 4 trays in the answer book and fill in the numbers of each cube.

b) In a 10 × 10 × 10 cube, how many cubes are numbered with 7? And how many are numbered with 13?

c) In a 2018 × 2018 × 2018 cube, which number appears most often in the numbering of the cubes? (If there are more than one number that appears the most times list them all.)

Attemp: I can't hide the graphics. Here's (a):

• Number is easy - you mean digit? – Moti Dec 23 '19 at 1:33

An n × n × n cube

Consider the day number $$i$$.

If $$i\le n$$, then the number of times it appears is $$1+2+...+i=\frac{i(i+1)}{2}$$.

If $$2n-1\le i\le 3n-2$$, then (symmetry) it appears the same number of times as the number $$3n-1-i$$.

If $$n< i<2n-1$$, then the number of times it appears is $$(i+1-n)+(i-n)+...(n-1)+n+(n-1)+...+(2n-i).$$

Note that it is the third of these formulae which will give the largest number of appearances and this will be when $$n$$ is as close as possible to being in the middle of the summation.Then $$n-(i+1-n)\approx n-(2n-i)$$ i.e. $$2i+1\approx 3n$$.

$$7$$ appears $$\frac{7\times8}{2}=28$$ times.
For $$13$$, we need $$4+...+9+10+9+...+7=73$$.
$$2i+1\approx 3\times 2018$$ when $$i=3026$$ and $$3027$$.