Let $f:\mathbb{Z}^2\rightarrow\mathbb{Z}$ be a function satisfying \[f(x+1,y)+f(x,y+1)+1=f(x,y)+f(x+1,y+1)\]for all integers $x$ and $y$. Can it happen that $|f(x,y)|\leq 2024$ for all $x,y\in\mathbb{Z}$?
2024 Philippine Math Olympiad
Day 1
Let $0!!=1!!=1$ and $n!!=n\cdot (n-2)!!$ for all integers $n\geq 2$. Find all positive integers $n$ such that \[\dfrac{(2^n+1)!!-1}{2^{n+1}}\]is an integer.
Given triangle $ABC$ with orthocenter $H$, the lines through $B$ and $C$ perpendicular to $AB$ and $AC$, respectively, intersect line $AH$ at $X$ and $Y$, respectively. The circle with diameter $XY$ intersects lines $BX$ and $CY$ a second time at $K$ and $L$, respectively. Prove that points $H, K$ and $L$ are collinear.
Let $n$ be a positive integer. Suppose for any $\mathcal{S} \subseteq \{1, 2, \cdots, n\}$, $f(\mathcal{S})$ is the set containing all positive integers at most $n$ that have an odd number of factors in $\mathcal{S}$. How many subsets of $\{1, 2, \cdots, n\}$ can be turned into $\{1\}$ after finitely many (possibly zero) applications of $f$?
Day 2
Find the largest positive integer $k$ so that any binary string of length $2024$ contains a palindromic substring of length at least $k$.
The sequence $\{a_n\}_{n\ge 1}$ of real numbers is defined as follows: $$a_1=1, \quad \text{and}\quad a_{n+1}=\frac{1}{2\lfloor a_n \rfloor -a_n+1} \quad \text{for all} \quad n\ge 1$$Find $a_{2024}$.
Let $ABC$ be an acute triangle with orthocenter $H$, circumcenter $O$, and circumcircle $\Omega$. Points $E$ and $F$ are the feet of the altitudes from $B$ to $AC$, and from $C$ to $AB$, respectively. Let line $AH$ intersect $\Omega$ again at $D$. The circumcircle of $DEF$ intersects $\Omega$ again at $X$, and $AX$ intersects $BC$ at $I$. The circumcircle of $IEF$ intersects $BC$ again at $G$. If $M$ is the midpoint of $BC$, prove that lines $MX$ and $OG$ intersect on $\Omega$.
Find all positive integers $n$ for wich $\phi(\phi (n))$ divides $n$.