At the vertices $A, B, C, D, E, F, G, H$ of a cube, $2001, 2002, 2003, 2004, 2005, 2008, 2007$ and $2006$ stones respectively are placed. It is allowed to move a stone from a vertex to each of its three neighbours, or to move a stone to a vertex from each of its three neighbours. Which of the following arrangements of stones at $A, B, \ldots , H$ can be obtained? $(\text{a})\quad 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2005;$ $(\text{b})\quad 2002, 2003, 2004, 2001, 2006, 2005, 2008, 2007;$ $(\text{c})\quad 2004, 2002, 2003, 2001, 2005, 2008, 2007, 2006.$
2004 Italy TST
Day 1
Let $\mathcal{P}_0=A_0A_1\ldots A_{n-1}$ be a convex polygon such that $A_iA_{i+1}=2^{[i/2]}$ for $i=0, 1,\ldots ,n-1$ (where $A_n=A_0$). Define the sequence of polygons $\mathcal{P}_k=A_0^kA_1^k\ldots A_{n-1}^k$ as follows: $A_i^1$ is symmetric to $A_i$ with respect to $A_0$, $A_i^2$ is symmetric to $A_i^1$ with respect to $A_1^1$, $A_i^3$ is symmetric to $A_i^2$ with respect to $A_2^2$ and so on. Find the values of $n$ for which infinitely many polygons $\mathcal{P}_k$ coincide with $\mathcal{P}_0$.
Find all functions $f:\mathbb{N}\rightarrow \mathbb{N}$ such that for all $m,n\in\mathbb{N}$, \[(2^m+1)f(n)f(2^mn)=2^mf(n)^2+f(2^mn)^2+(2^m-1)^2n. \]
Day 2
Two circles $\gamma_1$ and $\gamma_2$ intersect at $A$ and $B$. A line $r$ through $B$ meets $\gamma_1$ at $C$ and $\gamma_2$ at $D$ so that $B$ is between $C$ and $D$. Let $s$ be the line parallel to $AD$ which is tangent to $\gamma_1$ at $E$, at the smaller distance from $AD$. Line $EA$ meets $\gamma_2$ in $F$. Let $t$ be the tangent to $\gamma_2$ at $F$. $(a)$ Prove that $t$ is parallel to $AC$. $(b)$ Prove that the lines $r,s,t$ are concurrent.
A positive integer $n$ is said to be a perfect power if $n=a^b$ for some integers $a,b$ with $b>1$. $(\text{a})$ Find $2004$ perfect powers in arithmetic progression. $(\text{b})$ Prove that perfect powers cannot form an infinite arithmetic progression.
Given real numbers $x_i,y_i (i=1,2,\ldots ,n)$, let $A$ be the $n\times n$ matrix given by $a_{ij}=1$ if $x_i\ge y_j$ and $a_{ij}=0$ otherwise. Suppose $B$ is a $n\times n$ matrix whose entries are $0$ and $1$ such that the sum of entries in any row or column of $B$ equals the sum of entries in the corresponding row or column of $A$. Prove that $B=A$.