I have 10 balls that look identical on the outside, but one of them is radioactive, and I don't know which one. One of my acquaintances would only buy non-radioactive balls from me, at 1 forint each. Another acquaintance of mine has a device that can determine if there are any radioactive balls among any number of balls. He charges 1 forint per measurement, but his device has the property that if there is a radioactive ball among the measured balls, all of them become radioactive during the measurement.

What is the maximum profit I can definitely achieve?
(Solution for Az F. 2494.) Generally, for $n \geq 2$ balls, we answer the problem's question. Instead of profit, we examine the loss! This is the sum of the number of measurements and the number of balls that have become radioactive. Our task is to find: what is the smallest possible loss?

Let $H_{k}$ denote the sum of the first $k$ positive integers, i.e., let $H_{k}=\frac{k(k+1)}{2}$, the so-called $k$-th "triangular number". We claim that if $n \leq H_{k}+1$, then there is a measurement procedure in which we lose at most $k+1$ forints, while if $n>H_{k}+1$, then no matter what method we try, it is possible that our loss is at least $k+2$ forints.

Let $n \leq H_{k}+1=k+(k-1)+(k-2)+\ldots+2+2$. Then there exist non-negative integers $a_{1}, a_{2}, \ldots, a_{k-1}$ such that

$$
n=a_{1}+a_{2}+\ldots+a_{k-1}+2
$$

and

$$
a_{1} \leq k, \quad a_{2} \leq k-1, \ldots, a_{k-1} \leq 2
$$

Indeed, if $n=H_{k}+1$, then the choice

$$
n=k+(k-1)+\ldots+2+2
$$

is appropriate, and if $n < H_{k}+1$, we can choose the $a_{i}$ values appropriately to satisfy the conditions.

Now, let $n > H_{k}+1$ and assume there exists a measurement procedure in which the loss is at most $k+1$ forints, regardless of the order of the balls during measurement.

If in the $i$-th measurement we measure $a_{i}$ balls at once, then clearly $a_{i}+2 \leq (k+1)$ must hold, because if the radioactive ball happens to be among these, then with this measurement, our loss is $a_{i}+i$ forints. (We can obviously rule out the possibility that all measured balls are healthy, as we would not perform such a measurement.)

This means that with $l \leq k$ measurements, we can examine at most $k+(k-1)+\ldots+(k-l+1)$ balls. Thus, the number of balls not yet measured is at least

$$
\begin{gathered}
n-(k+(k-1)+\ldots+(k-l+1)) \geq H_{k}+2-(k+(k-1)+\ldots+(k-l+1))= \\
=2+(k-l)+(k-l-1)+\ldots+1 \geq 2+(k-1)
\end{gathered}
$$

After the $i$-th measurement, at least $(k-l)+2$ balls have not been examined. If all balls have been healthy so far and we stop the measurement, our loss is at least $l+(k-l)+2=k+2$ forints. If we measure $(k+1)$-th time and find the radioactive ball(s) only then, the loss is again at least $k+2$ forints.

Thus, we have shown that if $n>H_{k}+1$, then no matter how we try, it is possible that our loss (in the worst case) is at least $(k+2)$ forints.

If $H_{k}$ denotes the smallest triangular number not greater than $(n-1)$, then we can ensure that our loss is $k+1$ forints, but not less. Thus, we can safely count on a profit of at most $n-k-1$ forints. Since $H_{3}=6, H_{4}=10$, for $n=10$, $k=4$, and thus we can count on a profit of at most $10-(4+1)=5$ forints, for example, with the following grouping: $a_{1}=3, a_{2}=3, a_{3}=2, a_{4}=2$.

If $n=100$, then $H_{13}=91, H_{14}=105$ implies $k=14$, so we can count on a profit of at most $100-(14+1)=85$ forints. A possible measurement sequence is:

$$
a_{1}=14, \quad a_{2}=13, \ldots, a_{10}=5, \quad a_{11}=3, \quad a_{12}=0, \quad a_{13}=0, \quad a_{14}=2
$$

Remarks. 1. After some calculations, it turns out that for $n$ balls, the achievable profit is

$$
\left[\frac{2 n-1-\sqrt{8 n-7}}{2}\right] \text { forints. }
$$

2. In the solution, we sought the profit that we can achieve even in the "worst" case. We could also examine what the maximum expected profit is. This is not an easy question; here we only illustrate what it means with an example.

The measurement is performed by dividing the balls into piles of sizes $a_{1}, a_{2}, \ldots, a_{k}$, and then sending the piles of sizes $a_{1}, a_{2}$, etc., for measurement (except the last one). If the radioactive ball is in the $i$-th pile - the probability of which is $a_{i} / n$, our loss is $a_{i}+i$. Thus, the expected value of the loss is

$$
\frac{a_{1}}{n}\left(1+a_{1}\right)+\frac{a_{2}}{n}\left(2+a_{2}\right)+\ldots+\frac{a_{k-1}}{n}\left(k-1+a_{k-1}\right)+\frac{a_{k}}{n}\left(k-1+a_{k}\right)
$$

For 100 balls with the grouping described in the solution, this value is

$$
\begin{gathered}
\frac{14}{100}(14+1)+\frac{13}{100}(13+2)+\ldots+\frac{5}{100}(5+10)+ \\
+\frac{3}{100}(3+11)+\frac{2}{100}(2+11)=14.93
\end{gathered}
$$

Thus, the expected value of the loss is slightly less than 15, which is natural, since in two percent of the cases, it is already clear after 11 measurements that the remaining balls include the radioactive one.

One of the optimal groupings is the following:

$$
\begin{gathered}
a_{1}=10, a_{2}=a_{3}=9, a_{4}=a_{5}=8, a_{6}=a_{7}=7, a_{8}=a_{9}=6, a_{10}=a_{11}=5 \\
a_{12}=a_{13}=4, a_{14}=a_{15}=3, a_{16}=a_{17}=a_{18}=2
\end{gathered}
$$

In this case, it is possible that our loss exceeds 15 forints, but the probability of this is small. If, however, the radioactive ball is found in one of the first 7 measurements, the loss is only 13 or 14 forints, so it is worth taking the risk. The expected value in this case is 13.84 forints, which means that on average, we can win about 1 forint more than before.