# 2001 IMO Shortlist Problems/A1

## Problem

Let $T$ denote the set of all ordered triples $(p,q,r)$ of nonnegative integers. Find all functions $f:T \rightarrow \mathbb{R}$ such that $f(p,q,r) = \begin{cases} 0 & \text{if} \; pqr = 0, \\ 1 + \tfrac{1}{6}\{f(p + 1,q - 1,r) + f(p - 1,q + 1,r) & \\ + f(p - 1,q,r + 1) + f(p + 1,q,r - 1) & \\ + f(p,q + 1,r - 1) + f(p,q - 1,r + 1)\} & \text{otherwise.} \end{cases}$

## Solution

We can see that $h(p,q,r)=\frac{3pqr}{p+q+r}$ for $pqr\neq0$ and $h(p,q,r)=0$ for $pqr=0$ satisfies the equation. Suppose there exists another solution $f(p,q,r)$. Let $g(p,q,r)=f(p,q,r)-h(p,q,r)$. Plugging in $f=g+h,$ we see that $g$ satisfies the relationship $g(p,q,r)=\begin{cases} \tfrac{1}{6}\{g(p + 1,q - 1,r) + g(p - 1,q + 1,r) & \\ + g(p - 1,q,r + 1) + g(p + 1,q,r - 1) & \\ + g(p,q + 1,r - 1) + g(p,q - 1,r + 1)\}\end{cases}$, so that each value of $g$ is equal to 6 points around it with an equal sum $p+q+r$. This implies that for fixed $p+q+r$, $g(p,q,r)$ is constant. Furthermore, some values of $g$ are always zero; for example, $f(p,2,0)=0$ by the problem statement, and similarly, $h(p,2,0)=0$, so $g(p,2,0)=0-0=0$. Thus, $g$ must be identically zero, so $h$ is the only function satisfying this equation.