There are $n$ cards such that for each $i=1,2, \cdots n$, there are exactly one card labeled $i$. Initially the cards are piled with increasing order from top to bottom. There are two operations: $A$ : One can take the top card of the pile and move it to the bottom; $B$ : One can remove the top card from the pile. The operation $ABBABBABBABB \cdots $ is repeated until only one card gets left. Let $L(n)$ be the labeled number on the final pile. Find all integers $k$ such that $L(3k)=k$.
2019 Korea - Final Round
March 23rd - Day 1
For a rectangle $ABCD$ which is not a square, there is $O$ such that $O$ is on the perpendicular bisector of $BD$ and $O$ is in the interior of $\triangle BCD$. Denote by $E$ and $F$ the second intersections of the circle centered at $O$ passing through $B, D$ and $AB, AD$. $BF$ and $DE$ meets at $G$, and $X, Y, Z$ are the foots of the perpendiculars from $G$ to $AB, BD, DA$. $L, M, N$ are the foots of the perpendiculars from $O$ to $CD, BD, BC$. $XY$ and $ML$ meets at $P$, $YZ$ and $MN$ meets at $Q$. Prove that $BP$ and $DQ$ are parallel.
Prove that there exist infinitely many positive integers $k$ such that the sequence $\{x_n\}$ satisfying $$ x_1=1, x_2=k+2, x_{n+2}-(k+1)x_{n+1}+x_n=0(n \ge 0)$$ does not contain any prime number.
March 24th - Day 2
Let triangle $ABC$ be an acute scalene triangle with orthocenter $H$. The foot of perpendicular from $A$ to $BC$ is $O$, and denote $K,L$ by the midpoints of $AB, AC$, respectively. For a point $D(\neq O,B,C)$ on segment $BC$, let $E,F$ be the orthocenters of triangles $ABD, ACD$, respectively, and denote $M,N$ by the midpoints of $DE,DF$. The perpendicular line from $M$ to $KH$ cuts the perpendicular line from $N$ to $LH$ at $P$. If $Q$ is the midpoint of $EF$, and $S$ is the orthocenter of triangle $HPQ$, then prove that as $D$ varies on $BC$, the ratio $\frac{OS}{OH}$, $\frac{OQ}{OP}$ remains constant.
Find all pairs $(p,q)$ such that the equation $$x^4+2px^2+qx+p^2-36=0$$has exactly $4$ integer roots(counting multiplicity).
A sequence $\{x_n \}=x_0, x_1, x_2, \cdots $ satisfies $x_0=a(1\le a \le 2019, a \in \mathbb{R})$, and $$x_{n+1}=\begin{cases}1+1009x_n &\ (x_n \le 2) \\ 2021-x_n &\ (2<x_n \le 1010) \\ 3031-2x_n &\ (1010<x\le 1011) \\ 2020-x_n &\ (1011<x_n) \end{cases}$$for each non-negative integer $n$. If there exist some integer $k>1$ such that $x_k=a$, call such minimum $k$ a fundamental period of $\{x_n \}$. Find all integers which can be a fundamental period of some seqeunce; and for such minimal odd period $k(>1)$, find all values of $x_0=a$ such that the fundamental period of $\{x_n \}$ equals $k$.