Let $n > 1$ be a given integer. An $n \times n \times n$ cube is composed of $n^3$ unit cubes. Each unit cube is painted with one colour. For each $n \times n \times 1$ box consisting of $n^2$ unit cubes (in any of the three possible orientations), we consider the set of colours present in that box (each colour is listed only once). This way, we get $3n$ sets of colours, split into three groups according to the orientation. It happens that for every set in any group, the same set appears in both of the other groups. Determine, in terms of $n$, the maximal possible number of colours that are present.
Problem
Source: IMO 2017 Shortlist
Tags: combinatorics, IMO Shortlist
10.07.2018 14:13
Also, south korean TST #6.
10.07.2018 15:36
The answer is $\frac16 n(n+1)(2n+1)$. We present two solutions. First solution (mine) The main idea is to show that ``most'' colors appear at least three times, though there will be some colors appearing once or twice. We call a set appearing among the $3n$ sets a plate. Let us call a plate sharp if it appears exactly three times, once in each direction (the minimum possible). We say a color $c$ is 1-rare or 2-rare if it appears exactly once or exactly twice among the $n^3$ cells. Claim: If $c$ is 1-rare, then it lies in a unique plate $S$, that plate is sharp, and $c$ is the unique triple intersection. Proof. Clear. $\blacksquare$ Conversely, we may as well assume that any intersection of three sharp plates is 1-rare (if not, we replace the color of their intersection with a new color). We will do so in what follows. Claim: If $c$ is 2-rare, then either $c$ lies in a unique plate $S$, that plate is not sharp, and $c$ lies on the two triple intersections of the $S$ plates, or $c$ lies in exactly two plates $S$ and $T$, which are both sharp, and $c$ may only lie at triple intersections of the shape $SST$ or $STT$. Proof. If there is any non-sharp plate $S$ containing $c$, then we deduce we are in the first case. On the other hand, suppose $c$ is contained only in sharp plates. It must be contained in more than one plate, if $c$ not $1$-rare. But it also clearly is contained in at most two sharp plates. That implies the result. $\blacksquare$ Let $n_1$, $n_2$ be the number of 1-rare and 2-rare colors; let $n_3$ be the number of colors which are neither. Let $\alpha$ and $\beta$ denote the number of sharp and non-sharp plates. \begin{align*} \alpha + \beta &= n \\ n_1 &\le \alpha \\ n_2 &\le \beta + 3\binom{\alpha}{2} \\ n^3 &\ge n_1 + 2n_2 + 3n_3 = 3(n_1+n_2+n_3) - 2n_1 - n_2 \\ \implies \# \text{colors} &= n_1 + n_2 + n_3 \\ &\le \frac 13 n^3 + \frac 23 n_1 + \frac 13 n_2 \\ &\le \frac13 n^3 + \frac23 (\alpha) + \frac13\left( \beta + 3 \binom \alpha 2 \right) \le \frac13 n^3 + \frac23 (\alpha+\beta) + \binom{\alpha}{2} \\ &\le \frac13 n^3 + \frac23 n + \binom{n}{2} = \frac{n(n+1)(2n+1)}{6}. \end{align*} It remains to actually give an example achieving this number. This is easy to do by interpreting the equality case above (all plates are sharp). Impose coordinates $(x,y,z)$ with $a,b,c \in \{1, \dots, n\}$ We add $n$ 1-rare colors for each point $(i,i,i)$. We add $3 \binom n2$ 2-rare colors. For any $1 \le i < j \le n$, we have three colors; one on $(i,j,j)$ and $(j,j,i)$; one on $(i,j,i)$ and $(j,i,j)$; and one on $(j,i,i)$ and $(i,j,j)$. We add $2 \binom n3$ 3-rare colors. For any $1 \le i < j < k \le n$, we have two colors: one on $(i,j,k)$, $(j,k,i)$, and $(k,i,j)$; and one on $(k,j,i)$, $(i,k,j)$, and $(j,i,k)$. Remark: The 2-dimensional version of the problem is easier, but carries all the main ideas of the 3-dimensional version. So this is an example of a problem where looking at the small cases provides a major advantage. Here is an illustration with $n = 4$: \[ \begin{array}{c|cccc} & S_1 & S_2 & S_3 & S_4 \\ \hline S_1 & W & 12 & 13 & 14 \\ S_2 & 12 & X & 23 & 24 \\ S_3 & 13 & 23 & Y & 34 \\ S_4 & 14 & 24 & 34 & Z \end{array} \] Second solution (from the official shortlist) We proceed by induction on $n \ge 1$ on a strengthened version of the problem with two modifications: we allow cubes to be invisible (i.e.\ to not have a color). we still require every plate $S$ to be present in all three directions, unless $S = \varnothing$. Let $f(n)$ denote the maximum number of colors present. We will prove again that $f(n) \le 1^2 + 2^2 + \dots + n^2 = \frac16 n(n+1)(2n+1)$. The base case $n = 1$ is easy. For the inductive step, unless the entire cube is invisible (and hence has no colors at all), we can take an $S$-plate ($S \neq \varnothing$). Now suppose delete three $S$-plates (one in each direction), then turn invisible all colors that appeared anywhere in $S$. This resulting $(n-1) \times (n-1) \times (n-1)$ cube that still satisfies the conditions! Since $S$ had at most $n^2$ distinct colors in it, it follows that \[ f(n) \le n^2 + f(n-1) \]and so $f(n) \le \frac16 n(n+1)(2n+1)$ as desired. A construction was given at the end of the previous solution already.
25.09.2018 20:10
It seems like both solutions generalize to $\mathbb{Z}^n$ with plane replaced by $n\times...\times n \times 1$? Did I do something wrong?
25.09.2018 20:17
The second solution certainly does. The first solution should as well, although it becomes a lot messier.
20.11.2018 06:24
We claim that the maximal number of colors is $f(n):=1^2+2^2+\cdots+n^2=\boxed{\frac{n(n+1)(2n+1)}{6}}$. When solving the problem, the construction of the equality case was the most difficult part, whereas I found the bound to be fairly natural. We first present the equality case, then the bound. We construct a scenario with $f(n)$ colors inductively. Suppose we can color a cube of size $n-1$ with $f(n-1)$ colors such that the slices $x=a,y=a,z=a$ had the same set of colors, where we are viewing the cube as $\{1,\ldots,n-2\}^3$. Let a shell be the set of cubes with coordinates \[S=\{(x,y,z)\in\{0,\ldots,n-1\}^3:0\in\{x,y,z\}\}.\]Also let $X_a=\{(x,y,z)\in S : x=a\}$, and define $Y_a,Z_a$ similarly. We will show that one can color a shell $S$ with $n^2$ colors such that the set of colors of $X_a,Y_a,Z_a$ are identical. Then, by stacking this shell on top of the $n-1$ cube (so the $n-1$ cube is now $\{1,\ldots,n-1\}^3$), we will get the desired configuration (namely the color set for $x=a$ will be the same set for $y=a$ and $z=a$). We will now color the shell in a way so that the slices $x=a,y=a,z=a$ all have the same color sets. Color the cubes of the form $(x,y,0)$ with $n^2$ different colors. Now, for $a,b$ that are distinct and not $0$, identify $(0,0,a)\sim(a,a,0)$ $(a,0,a)\sim(0,a,0)$ $(0,a,a)\sim(a,0,0)$ $(0,a,b)\sim(a,b,0)\sim(b,0,a)$ where $(x,y,z)\sim(x',y',z')$ if and only if they have the same color. We will first show that the color set of $Y_0$ is the same as the color set of $Z_0$ (the others follow similarly). Note that we have a bijection from $Y_0$ to $Z_0$ that sends \begin{align*} (0,0,0)&\mapsto(0,0,0)\\ (0,0,a)&\mapsto(a,a,0)\\ (a,0,0)&\mapsto(a,0,0)\\ (a,0,a)&\mapsto(0,a,0)\\ (a,0,b)&\mapsto(b,a,0) \end{align*}where again, $a,b,0$ are all different from each other. Note that this bijection preserves color, so the color sets of $Y_0$ and $Z_0$ are the same. We now show that the color set of $X_c$ is the same as that of $Z_c$ where $1\le c\le n-1$ (again the others follow similarly). We have the bijection from $X_c$ to $Z_c$ given by \begin{align*} (c,0,0)&\mapsto(0,c,c)\\ (c,0,c)&\mapsto(c,0,c)\\ (c,c,0)&\mapsto(0,0,c)\\ (c,a,0)&\mapsto(a,0,c)\\ (c,0,a)&\mapsto(0,a,c) \end{align*}where $a\not=c$ and $a\not=0$. Again, this bijection is color preserving, so we have the desired property that the slices $X_c,Y_c,Z_c$ of the shell have the same color sets. As said before, stacking $n$ such shells with decreasing size demonstrates equality of the bound of $f(n)=1^2+2^2+\cdots+n^2$. We now show that the number of colors is at most $f(n)$ in a valid configuration. Note that swapping two parallel slices (say $x=a$ and $x=b$) preserves the validity of the configuration. Suppose each group of parallel slices had a total of $m$ distinct color sets. Then permute slices so that the slices $x=0$ to $x=m-1$ are all distinct sets (same for $y$ and $z$), and such that the slices $x=a,y=a,z=a$ all have the same color sets for $0\le a\le m-1$. Now, partition the cube into $n$ shells, starting with size $n$ ($\{(x,y,z)\in\{0,\ldots,n-1\}^3:0\in\{x,y,z\}\}$), then size $n-1$ (union of $\{(x,y,z)\in\{1,\ldots,n-1\}^3:1\in\{x,y,z\}\}$), and so on till size $1$. Note that the cubes in the $(m+1)$th shell and onward (so the shells with size at most $n-m$) are in the slice $x=a$ for some $a\ge m$, so all colors there have shown up in shells $0$ to $m-1$. Lemma: The shell with size $x$ can have at most $x^2$ colors that did not appear in the shells with larger size. Proof of Lemma: Suppose we were able to add at least $x^2+1$ new colors. Note that the set of new colors in each of the three orthogonal slices of size $x^2$ (call them the three faces, note they intersect) must be the same (a new color is one that did not appear in the shells of color bigger than $x$). But there must be some new color that is in one of the three faces since there are $x^2+1$ new colors (by pigeon-hole), so we have a contradiction. $\blacksquare$ Therefore, at the shell of size $n$, we add at most $n^2$ new colors, at the next shell (of size $n-1$) we add at most $(n-1)^2$ new colors, and so on until the shell of size $n-m+1$ where we add at most $(n-m+1)^2$ new colors (as noted before, all other shells add no new colors). Therefore, the total number of colors is at most \[n^2+(n-1)^2+\cdots+(n-m+1)^2\le f(n),\]as desired. This completes the proof. $\blacksquare$ Comments: I came up with the second part (showing the bound first), and tried then to reverse engineer the equality case. This proved to be quite difficult as thinking in 3D is hard, so I came up with the induction idea. It turns out, you can draw the information of the colors of on shell in 2D. This can be used to motivate the equivalence classes and bijection. Below is a picture of a shell with size $4$ that is colored in accordance with the equality case (its the one I used when solving the problem). Note that the equality case is somewhat forced upon you (after some arbitrary choices, filling out the equality case for $n=4$ felt like a Sudoko puzzle or something).
22.02.2019 05:34
EDIT: I made a somewhat minor error. I have edited the proof to account for this.
25.03.2019 17:29
@2above: I also had the same problem, but I found that if you draw 3 3x3 grids side by side and pretend they are stacked on each other, it is easier to visualize the cube. Visualization techniques and experimentation are very underestimated skills in combo!
25.03.2019 22:03
@above That's what I originally was doing, but the way the induction is set up, the "surface" of the cube (which was the way I ended up doing it) seemed more relevant.
07.10.2019 23:48
Little typo in what Evan wrote (I have corrected below): v_Enhance wrote: $n^3 \ge n_1 + 2n_2 + 3n_3 = 3(n_1+n_2+n_3) - 2n_1 - n_2 $ beautiful solution though !
27.02.2020 17:48
Beautiful! We claim the answer is $a_n = 1^2+2^2+...+n^2 = n(n+1)(2n+1)/6$ for all $n \ge 1$. Throughout the solution, the cube is the set of lattice points $(i, j, k)$ with $1 \le i,j,k \le n$ (we can consider the unit cubes as the lattice points). Two planes are said to 'agree' if they have the same colour-set (called c-set from now on). The colour of $(i, j, k)$ is denoted by $c(i, j, k)$. A plane with $z$-coordinate constant is called a $z$-plane, symmetric notation holding for $x$-planes and $y$-planes. We only consider these three types of planes. We first prove that the $a_n$ is an upper bound. We construct a set $S$ consisting of all the colours present in the large cube. We'll construct a sequence of distinct $z$-planes with at most $n$ members in the sequence, adding the colours of each $z_i$ to $S$ as we go, such that $|S|$ is at most $n^2+(n-1)^2+...+(n-i+1)^2$ just after we've constructed the sequence till $z_i$. No two $z_i$ will agree with each other. Consider any $z$-plane. Call it $z_1$. Add its colours to $S$. $|S|$ increases by at most $n^2$. After the sequence has been constructed till $z_i$, look for a $z$-plane whose c-set isn't a subset of $S$. If no such plane exists, $S$ has been constructed and we're done. Otherwise, take such a plane, call it $z_{i+1}$ and add its colours to $S$. Note that $|S|$ increases by at most $(n-i)^2$ as $i$ of $z_{i+1}$'s rows and $i$ of its columns are covered by $x$- or $y$- planes agreeing with a previously choosen $z$-plane (the rows and columns are distinct because no two $z_j$ agree with each other). So we're done. We'll give an inductive contruction for $n$, such that planes $x = k, y = k, z = k$ agree with each other for $1 \le k \le n$, with the c-set of any $z$-plane having cardinality $n^2$. Call the construction cube for $n$, $T_n$. The construction for $n = 1$ is simply $(1, 1, 1)$ coloured by any colour. To get $T_n$ from $T_{n-1}$, translate $T_{n-1}$ by $(1, 1, 1)$, colour the unit cubes $(i, j, 1)$ with $n^2$ distinct colours which are different from the colours used in $T_{n-1}$. For $j \ne 1$, set $c(j, 1, j) = c(1, j, 1)$ and $c(1, j, j) = c(j, 1, 1)$, $c(1, 1, j) = c(j, j, 1)$. For $1\neq i \neq j \neq 1$, set $c(1, i, j) = c(j, 1, i) = c(i, j, 1)$. First note that each $z$-plane has c-set of cardinality $n^2$. So to prove the agreement part we only need to prove that each colour of $z = k$ exists in $x = k$ and $y = k$. Then note that $x = 1$ agrees with $z = 1$ (simply see that colours of $(1, 1, 1), (1, i, 1), (i, 1, 1), (i, i, 1), (i, j, 1)$ are accounted for). Similarly $y = 1$ agrees with $z = 1$. For $z$-plane $z = k$ for $k \neq 1$, we only need to account for the points $(1, 1, k), (1, k, k), (k, 1, k), (i, 1, k), (1, i, k)$ for each of $x = k$ and $y = k$, as the others are already accounted for by the inductive hypothesis. Check the accountancies,and we're done.
08.04.2021 03:01
The answer is $\sum\limits_{i=1}^n i^2=\frac{n(n+1)(2n+1)}{6}$ Construction: Let $(i,j,k)$ denote the color of the cube on the $i$th layer from the front, $j$th layer from the left, and $k$th layer from the top. Consider $(i,j,j)=(j,i,i), (i,j,i)=(j,i,j), (i,i,j)=(j,j,i), (i,j,k)=(j,k,l)=(k,i,j)$ if $(i-j)(j-k)(k-i)\ne 0$. Let $P_i=(i,j,k): 1\le j,k\le n$ and $R_i=(j,i,k): 1\le j,k\le n$ and $C_i=(j,k,i), 1\le j,k\le n$. Here, $(i,j,k)=P_i\cap R_j\cap C_k$. We can easily verify $P_i=R_i=C_i$. Bound: Let $S_i$ be the set of colors showing up $i$ times. I will show $|S_1|\le n$ and $|S_2|+|S_1|\le 3n(n-1) + n$. If I show this, the number of colors is at most $|S_1| + \frac{|S_2|}{2} + \frac{n^3-|S_1|-|S_2|}{3} = \frac{n^3}{3} + \frac{2}{3}|S_1| + \frac{1}{6} |S_2|\le\frac{n(n+1)(2n+1)}{6}$ First I show $|S_1|\le n$. I claim if $(x,y,z)$ is the only block with color $X$ and $(x,a,b)$ is the only block with color $W$, then $X=W, y=a, z=b$. If $(x,y,z)$ is the only block with color $X$, then $P_x=R_y=C_z$. Similarly, $P_x=R_a$, so $R_y=R_a$. Since $X\in R_y, X\in R_a$, contradiction. This implies the result because if there are $n+1$ points, two of them must be the same point. Now I show $|S_2|\le 3n(n-1)$. I claim if $x\ne A, (x,y,z), (A,b,c)$ are the only cubes of the same color, call $X$, and $(x,m,n), (A,p,q)$ are the only cubes of of the same color, then $(y,z)=(m,n), (p,q)=(b,c)$. First, note $\{P_x,P_A\}=\{R_y, R_b\} = \{C_z, C_c\}$ because they're the only "faces" with that color. Therefore, $\{R_y,R_b\}=\{R_m,R_q\}$. Note all planes on the left side use a cube of color X, so all planes on the right side use a cube of color X. If the right side features a new plane, it also contains color X, so color X is used three times. Therefore, for each pair $(x,A), x\ne A$ there can be at most one with $(x,y,z), (A,b,c)$, also at most one with $(y,x,z), (b,A,c)$ and also one with $(y,z,x), (b,c,A)$, so there are $6$ pairs. Therefore, $|S_2|\le 3n(n-1)$.
29.08.2021 23:18
The answer is $\frac{n(n+1)(2n+1)}{6} = 1^2 + 2^2 + \ldots + n^2$. Consider the transformation $(i,j,k) \Rightarrow (k,i,j)\Rightarrow (j,k,i)$ for $i\neq j\neq k$, and $(i,i,j) \Rightarrow (j,j,i)$. For every triplets/pairs of these points, color them with the same color that's distinct from every other color (also color each $(i,i,i)$ with a distinct color). This preserves the condition ($x = i$ planes has same colors as $y = i, z = i$). Furthermore, this gives $\frac{n(n+1)(2n+1)}{6}$ colors. We prove this bound by induction on $n$. Our base case of $1$ clearly means at most $1$ color, which fits the bound. Now, for our inductive step, assuming it works for $n$. Then, consider three planes with distinct orientations that have the same color set. By removing these three planes, we remove at most $(n+1)^2$ colors; we can also remove any color that were on at least one of these three planes. By our inductive hypothesis, there are at most $1^2 + 2^2 + \ldots + n^2$ colors left, so adding back $(n+1)^2$ proves our bound.
01.03.2022 01:31
The answer is $\boxed{\sum_{i=1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6}.}$ Construction: Assign the cubes coordinates. We put the color in $(a,b,c)$ in $(c,a,b)$ and $(b,c,a)$ as well for distinct integers $a,b,c.$ For distinct integers $a,b,$ we also put the color in $(a,a,b)$ in $(b,b,a),$ the color in $(a,b,a)$ in $(b,a,b),$ the color in $(b,a,a)$ in $(a,b,b).$ If two cells don't fit any of these cases, we give them different colors. This yields the needed number of colors. Now consider the color of any cube with $x$ coordinates equal to $a,$ where $a$ is any integer. Our construction guarantees there must be a cube with $y$ coordinate equal to $a$ as well as a cube with $z$ coordinate equal to $a$ both sharing the same color; furthermore, any cube with that color must have one of its coordinates equal to $a.$ By symmetry, any set of colors in a box satisfies the constraint so the construction works. $\blacksquare$ Bound: We loosen the constraint by allowing cells to be empty, i.e. not be assigned any color at all. We prove with induction on $n \ge 1.$ The base case is trivial. Say we have an $n\times n \times n$ cube. Just remove an $n \times n \times 1$ box, an $n \times 1 \times n$ box, and a $1 \times n \times n$ box that have the same set of colors. This removes at most $n^2$ colors. Also, make any remaining cells with colors that were part of the removed set of cells, blank. Then the resulting $(n-1) \times (n-1) \times (n-1)$ cube still satisfies the restrictions and induct down. $\blacksquare$
06.12.2022 20:33
Answer: The maximum amount of colors is $1^2+2^2+\dots +n^2=\frac{n(n+1)(2n+1)}{6}.$ Solution: First we prove the upper bound, then we provide a construction. Swap the boxes so that the $i$--th $x, y, z$ box contain the same set of colors. Now, consider the $n$ shells defined by $$S_i=(\{i\}\times [i]\times [i])\cup ([i]\times \{i\}\times [i])\cup ([i]\times [i]\times \{i\}) \text{ for } 1\leq i \leq n$$(here $[n]=\{1, 2, \dots, n\}$). Claim: For any $1\leq i\leq n$ are at most $i^2$ colors that appear in $S_i$ and not in $S_j$ for $i+1\leq j\leq n$. Proof: Any color appearing in $S_i$ for ''the first time'' must appear in $\{i\}\times [i]\times [i]$ by definition. Since $\vert \{i\}\times [i]\times [i]\vert=i^2$ we are done. $\blacksquare$ Since the amount of colors is just the sum of all the ''new colors'' in each shell, we immediately extract an upper bound of $$1^2+2^2+\dots +n^2.$$ For the construction, assign a diferent color to each of the following sets $\{(i, i, i)\}$ for $1\leq i \leq n$. $\{(i, j, j), (j, i, i)\}$, $\{(j, i, j), (i, j, i)$ and $\{(j, j, i), (i, j, j)\}$ where $1\leq i <j\leq n$. $\{(i, j, k), (j, k, i), (k, i, j)\}$ where $1\leq i, j, k\leq n$ are all distinct. This achieves the equality case, as desired. $\square$
24.12.2022 16:23
i got motivation to do this problem by solving its 2d version, it was direct then
02.05.2023 15:05
Let call a $n\times n\times 1$ box a $\emph{layer}$. And call them $x$, $y$ and $z$ layers by their orientation. And label them as $x_1, x_2, \dots, x_n$ and same for $y$ and $z$. Let, $C(x_i)$ be the set of colors present in $x_i$ layer. and same for $y$ and $z$. Let $X = \{C(x_1), C(x_2), \dots, C(x_n)\}$ and same for $Y$ and $Z$. Then, $X = Y = Z$. Let, $k = |X|$. Now notice that, if we rearrange the layers in $x$ direction then that doesnt change any condition of the problem and same for $y$ and $z$. Now we can assume that $C(x_i) = C(y_i) = C(z_i)$ for all $i \leq k$. Now, for any $x_i$ with $i > k$ we get all the colour of that layer in another layer $x_j$ with $j \leq k$. So number of colours is $|C(x_1) \cup C(x_2) \cup \dots \cup C(x_k)|$. Now we bound this. We count total distinct colour from layer $x_1$ to $x_k$. Let, $(x, y,z) $ be the position of a unit cube in the cube. For, layer $x_i$, the unit cubes $(x, y, z)$ with $y < i$ or $z < i$ will have a colour that is contained in some $x_j$ with $j < i$ [Because, $C(x_i) = C(y_i) = C(z_i)$ for all $i \leq k$]. So, total number of new colour in $x_i$ is at most $(n-i+1)^2$. So in this way total colour is at most $n^2 + (n-1)^2 + \dots + (n-k+1)^2$. So if $k = n$ then we get at most $n^2 + (n-1)^2 + \dots + 1^2 = \frac{n(n+1)(2n+1)}{6}$. Now, we give a construction for this. We give $(x, y, z) = (a,a,a)$ a colour [different for each $a$]. We give $(x, y, z) = (a,a,b)$ as the same colour as $(b, b, a)$ and also it's cyclic order. Now we give, $(x, y, z) = (a,b,c)$ as the same colour as $(b, c, a)$ and also $(c, a, b)$. And so on. We can easily check that in this way we use $n^2 + (n-1)^2 + \dots + 1^2 = \frac{n(n+1)(2n+1)}{6}$ colours. And in this way we get $C(x_i) = C(y_i) = C(z_i)$ for all $i \leq n$. So we are done. $\blacksquare$
29.06.2023 18:33
Answer: The maximum number of colors is \[ f(n) := 1^2+2^2+\ldots+n^2=\boxed{\frac{n(n+1)(2n+1)}{6}}. \] Construction: Define $T: \mathbb{Z}^3 \rightarrow \mathbb{Z}^3$ by $T((i, j, k)) = (k, i, j)$ when $i \neq j$ and $j \neq k$; $T((i, i, j)) = (j, j, i)$ when $i \neq j$; $T((i, i, i)) = (i, i, i)$. Take a maximal coloring that satisfies the condition that for all $\textbf{p} \in \mathbb{F}_n^3$, $T(\textbf{p})$ and $\textbf{p}$ have the same color. This induces $f(n)$ used colors. Bound: We prove the bound of $f(n)$ using induction on $n$. The base case $n=1$ is trivially true. Now consider for $n \ge 2$ a $n \times n \times n$ cube. Remove $3$ planes with pairwise distinct orientations that have the same color set; this removes at most $n^2$ colors. From the inductive hypothesis the resulting $(n-1) \times (n-1) \times (n-1)$ cube has at most $f(n-1) = 1^2+2^2+\ldots+(n-1)^2$ colors, so the original $n \times n \times n$ has at most $n^2$ more new colors (thus containing at most $f(n)$ colors), which completes the induction.
30.12.2023 18:25
We claim that the answer is $1+4+9+\dots+n^2=\tfrac{1}{6}n(n+1)(2n+1)$. Assign coordinates to each unit cube in the normal way. Let $C(i,j,k)$ be the color at $(i,j,k)$. Let the only restrictions be $C(a,b,c)=C(b,c,a)=C(c,a,b)$ for all $a,b,c$ mutually distinct. $C(a,a,b)=C(b,b,a)$, $C(a,b,a)=C(b,a,b)$, and $C(b,a,a)=C(a,b,b)$ for all $a\neq b$. First, we prove that any coloring following these constraints works. Consider the box $x=a$. If some cube in this box has color $C_0$ then there must also exist a cube in the box $y=a$ and $z=a$ with that same color. Therefore the set of colors in the $x$-direction is injective of the other two directions, and by symmetry they are bijections, as desired. If we allow colors to different as long as the conditions above are satisfied, we get exactly $\tfrac{1}{6}n(n+1)(2n+1)$ colors. To prove the bound, suppose that we allow there to be colorless squares, and this "colorless" color does not appear in any set. We now proceed by induction. Apply the following operation: Given an $n\times n \times n$ cube that satisfies the conditions with $c$ colors, then if we remove $x=a$, $y=b$, $z=c$ as well as discolor any other squares whose color we just touched, we remove at most $n^2$ colors and get another $n-1\times n-1\times n-1$ cube satisfying the conditions. We are done.
01.01.2024 22:35
similar to #7? didn't find it too bad but the writeup is A okay i got actually screwed over and computer froze mid writeup. i dont wanna write that all over again so like Answer is $1^2+\dots+n^2$. Construction is to consider the following: first have a space diagonal with colors $1,\dots,n$. Now split into shells of $k\times k\times k$ minus a $(k-1)\times (k-1)\times (k-1)$. For a shell of size $k$, color each of the three edges as $a_c,a_{c+3},\dots,a_{c+3(k-2)}$ for $c\in \{1,2,3\}$ starting from the vertex. Now for each face diagonal opposite an edge, color $a_c,a_{c+3},\dots,a_{c+3(k-2)}$ for $c\in \{1,2,3\}$ starting from the vertex. Now make all other colors appear exactly $3$ times by using $3$-symmetry about the space diagonal. Each shell provides $(k-1)^2-(k-1)+3(k-1)+1=k^2$ colors. Hence there are $1^2+\dots+n^2$ colors used. (The construction works because of $3$-symmetry.) Categorize colors as follows: Type $A$ colors appear once. Type $B$ colors appear twice. Type $C$ colors appear three or more times. Define the color set of a region to be the set of distinct colors in the region. After a bit of thinking I came across the following claim, which I think is very hard to find unless you really have some very good motivation (see the some spam hide tag). Call a unit cube good if it is at the intersection of three differently-oriented faces with the same color sets. Call the union of this cube and its faces a shell. (Technically, I used this terminology in the construction, but whatever.) Claim: There exists a set of $k\le n$ good cubes, no two of which share a face, such that the union of the color sets of the $k$ corresponding shells is equal to the color set of the entire cube. Proof: Consider a graph on $3n$ vertices where each vertex represents a face. Connect two differently-oriented faces if they have the same color set. Each connected component has $a,b,c\ge 1$ vertices in each of the three directions. Now just take one vertex for each direction. The union of these three faces forms a shell. Now remove the connected component and repeat. To finish the problem, we'll sequentially add in shells above and bound the number of new colors added. Suppose we have already added $s$ shells where $s\ge 0$. Claim: Addition of the $s+1$th shell provides at most $(n-s)^2$ new colors. Proof: It helps to WLOG that the complement of the union of the first $s$ shells is a cube $C$ of size $(n-s)\times (n-s)\times (n-s)$. Also assume that the vertex of the $s+1$th shell is at a corner of this cube. All new colors are within $C$. Notice the following: There are three edges emanating from the vertex with sizes $n-s-1$. Any new type $B$ color which does not appear at the vertex must appear twice in the shell. Furthermore, as all three faces must contain this color (of which there are only two appearances), one such appearance must be along an edge. There are therefore at most $3(n-s-1)$ type $B$ colors not appearing at the vertex. There is at most one type $A$ color, and it must appear at the vertex. We will use a basic inequality to make the rest simpler. Assume there are $c\le 3(n-s-1)$ type $B$ colors not appearing at the vertex. Now include the vertex; we have at most $c+1$ colors which combined take $2c+1$ cubes. The rest of our colors must be of type $C$. The total number of colors added is at most \[\frac{(3(n-s-1)^2+3(n-s-1)+1)-(2c+1)}{3}+c+1=(n-s-1)^2+(n-s-1)+\frac{c+3}{3}\]which is at most \[(n-s-1)^2+(n-s-1)+(n-s-1)+1=(n-s)^2\]which proves the claim. This claim clearly proves the maximum number of colors to be $1^2+\dots+n^2$. We are done. (Small note: I think there should be a way for induction to work on the final step. I didn't try it because I think there are some annoying details to work through, but I might just be wrong.) (I also don't think the inequality was strictly necessary, but I really want to make sure this isn't a fakesolve. Hopefully it isn't!)
14.06.2024 19:37
The answer is $1^2 + 2^2 + \dots + n^2 = \frac{n(n+1)(2n+1)}{6}$. Construction: Apply a coordinate system starting from $1$ to refer to individual unit cubes. We use induction to find a construction in which starting from $(1, 1, 1)$, the vertical boxes $k$ cubes in the positive $x$ or $y$ directions and the horizontal box $k$ cubes in the positive $z$ direction contain the same set of colors, which clearly suffices. The base case $n=1$ clearly works. Now suppose such an $(n-1) \times (n-1) \times (n-1)$ cube exists. To construct an $n \times n \times n$ cube, we translate the $(n-1) \times (n-1) \times (n-1)$ cube by one unit in each direction and fill in the new space that is the shape of three faces of a cube that share a vertex. Call a shape of this kind with side length $s$ an $s$-corner. We will inductively construct an $n$-corner that when added to an $(n-1) \times (n-1) \times (n-1)$ cube produces an $n \times n \times n$ cube that satisfies the conditions. The base case $n=1$ is clear. Now suppose we have such an $(n-1)$-corner. To construct an $n$-corner, we replace each of the original colors with a new color and then add on to the sides of the $(n-1)$-corner. For $1 < k < n$, add a unit cube of a new color $a_k$ at $(n, 1, k)$ and cyclic permutations, then add a unit cube of a different new color $b_k$ at $(n, k, 1)$ and cyclic permutations. Then add a unit cube of a new color $c_1$ at $(n, 1, 1)$ and $(1, n, n)$, then add a unit cube of a new color $c_2$ at $(1, n, 1)$ and $(n, 1, n)$. Finally, add a unit cube of a new color $c_3$ at $(n, n, 1)$ and $(1, 1, n)$, creating an $n$-corner. We add this to the $(n-1) \times (n-1) \times (n-1)$ cube to create an $n \times n \times n$ cube, which can be checked to work. Bound: Let $f(n)$ be the maximal possible number of colors in a cube of side length $n$ that satisfies the conditions and is allowed to have some unit cubes removed from it. We prove $f(n) \leq 1^2 + 2^2 + \dots + n^2$ using induction. For the base case $n = 1$, clearly $f(n) \leq 1$. Now suppose $f(n-1) \leq 1^2 + 2^2 + \dots + (n-1)^2$. In a cube of side length $n$, we can delete three boxes of different orientations with the same set of colors, along with any other unit cubes that are of any color in the set. This removes at most $n^2$ colors of cubes. We then obtain an $n-1$ cube that also satisfies the conditions, possibly with some unit cubes removed. This shows that $f(n) - n^2 \leq f(n-1)$ and the induction is complete.