$(a)$ Prove that for every positive integer $n$, the number of ordered pairs $(x, y)$ of integers satisfying $x^2-xy+y^2 = n$ is divisible by $3.$ $(b)$ Find all ordered pairs of integers satisfying $x^2-xy+y^2=727.$
2000 Turkey Team Selection Test
Day 1
In a triangle $ABC,$ the internal and external bisectors of the angle $A$ intersect the line $BC$ at $D$ and $E$ respectively. The line $AC$ meets the circle with diameter $DE$ again at $F.$ The tangent line to the circle $ABF$ at $A$ meets the circle with diameter $DE$ again at $G.$ Show that $AF = AG.$
Let $P(x)=x+1$ and $Q(x)=x^2+1.$ Consider all sequences $\langle(x_k,y_k)\rangle_{k\in\mathbb{N}}$ such that $(x_1,y_1)=(1,3)$ and $(x_{k+1},y_{k+1})$ is either $(P(x_k), Q(y_k))$ or $(Q(x_k),P(y_k))$ for each $k. $ We say that a positive integer $n$ is nice if $x_n=y_n$ holds in at least one of these sequences. Find all nice numbers.
Day 2
Show that any triangular prism of infinite length can be cut by a plane such that the resulting intersection is an equilateral triangle.
Points $M,\ N,\ K,\ L$ are taken on the sides $AB,\ BC,\ CD,\ DA$ of a rhombus $ABCD,$ respectively, in such a way that $MN\parallel LK$ and the distance between $MN$ and $KL$ is equal to the height of $ABCD.$ Show that the circumcircles of the triangles $ALM$ and $NCK$ intersect each other, while those of $LDK$ and $MBN$ do not.
Suppose $f:\mathbb{R} \to \mathbb{R}$ is a function such that \[|f(x+y)-f(x)-f(y)|\le 1\ \ \ \text{for all} \ \ x, y \in\mathbb R.\] Prove that there is a function $g:\mathbb{R}\to\mathbb{R}$ such that $|f(x)-g(x)|\le 1$ and $g(x+y)=g(x)+g(y)$ for all $x,y \in\mathbb R.$