6. let $T$ be the set of all triples $(p, q, r)$ of non-negative integers. Determine all functions $f: T \rightarrow \mathbb{R}$ for which

$$
f(p, q, r)= \begin{cases}0 & \text { for } p q r=0 \\ 1+\frac{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 { else. }\end{cases}
$$

## Solution
We first prove that at most one such function exists. Assume that $f$ and $g$ fulfill the conditions of the task. For the function $h=f-g$ then applies

$$
h(p, q, r)= \begin{cases}0 & \text { for } p q r=0 \\ \frac{1}{6}\{h(p+1, q-1, r)+h(p-1, q+1, r) \\ +h(p-1, q, r+1)+h(p+1, q, r-1) \\ +h(p, q+1, r-1)+h(p, q-1, r+1)\} & \text { else. }\end{cases}
$$

The seven points at which $h$ is evaluated in the defining equation all lie on a plane of the form $p+q+r=n$. Only a finite number of points from $T$ lie on this plane. We show that $h$ disappears identically on each such plane. Fix $n \geq 0$ and assume that $M=h\left(p_{0}, q_{0}, r_{0}\right)$ is the maximum of $h$ on the plane $p+q+r=n$. We can assume that $p_{0} q_{0} r_{0} \neq 0$ holds, otherwise $M=0$. It follows from the functional equation and the maximality of $M$ that $h$ also assumes the value $M$ at the 6 points $\left(p_{0}+1, q_{0}-1, r_{0}\right), \ldots,\left(p_{0}, q_{0}-1, r_{0}+1\right)$. In particular, $h\left(p_{0}-1, q_{0}+1, r_{0}\right)=M$. By repeating this argument, $M=h\left(p_{0}, q_{0}, r_{0}\right)=h\left(p_{0}-1, q_{0}+1, r_{0}\right)=\ldots=h\left(0, q_{0}+p_{0}, r_{0}\right)=0$.

The same reasoning, applied to $-h$, shows that the minimum of $h$ on the plane $p+q+r=n$ is also equal to 0, hence $h$ disappears identically.

Finally, it is easy to calculate that the function

$$
f(p, q, r)= \begin{cases}0 & \text { for } p=q=r=0 \\ \frac{3 p q r}{p+q+r} & \text { else. }\end{cases}
$$

fulfills all the conditions of the task. It is therefore the only solution.