A sports competition lasting $n \quad(n>1)$ days distributed a total of $m$ medals. On the first day, 1 medal and $1 / 7$ of the remaining medals were awarded, on the second day, 2 medals and $1 / 7$ of the remaining medals, and so on. Finally, on the $n$-th, and last day, exactly $n$ medals were awarded, which were the remaining medals.

How long did the sports competition last and how many medals were awarded in total?
I. solution. From the $n$ coins left on the last day, we can calculate how many were left on the previous day, from that the number of coins distributed on the previous day, and so on, until we finally get the total number of coins distributed during the competition. In general, if there were $m_{k}$ coins in the morning of the $k$-th day and $d_{k}$ coins were distributed during the day, then

$$
\begin{aligned}
d_{k} & =k+\frac{m_{k}-k}{7} \quad \text { and } \\
m_{k+1}=m_{k}-d_{k} & =m_{k}-k-\frac{1}{7}\left(m_{k}-k\right)=\frac{6}{7}\left(m_{k}-k\right)
\end{aligned}
$$

From here, expressing $m_{k}$ in terms of $m_{k+1}$ and denoting the fraction $7 / 6$ by $q$,

$$
m_{k}=k+q m_{k+1}
$$

Thus we get in sequence that

$$
m_{n}=n, m_{n-1}=(n-1)+q n, m_{n-2}=(n-2)+q(n-1)+q^{2} n, \ldots
$$

finally the total number of (not yet distributed on the first morning) coins

$$
m=m_{1}=1+2 q+3 q^{2}+\ldots+n q^{n-1}
$$

This sum can be simplified by breaking it down into geometric series with one fewer term each, and summing these series individually:

$$
\begin{aligned}
1+q+q^{2}+\ldots+q^{n-2}+q^{n-1} & =\frac{q^{n}-1}{q-1} \\
q+q^{2}+\ldots+q^{n-2}+q^{n-1} & =q \cdot \frac{q^{n-1}-1}{q-1}=\frac{q^{n}-q}{q-1} \\
q^{2}+\ldots+q^{n-2}+q^{n-1} & =q^{2} \cdot \frac{q^{n-2}-1}{q-1}=\frac{q^{n}-q^{2}}{q-1} \\
\ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots & =\frac{q^{n}-q^{n-2}}{q-1} \\
q^{n-2}+q^{n-1} & =q^{n-2} \cdot \frac{q^{2}-1}{q-1} \\
q^{n-1} & =q^{n-1} \cdot \frac{q-1}{q-1}=\frac{q^{n}-q^{n-1}}{q-1}
\end{aligned}
$$

The denominators and the first terms of the numerators of the consecutive sums are equal, and their second terms are, respectively, the negative of the corresponding terms of the first series above. Thus the sum of the sums, writing back the value of $q$ and extending by $6^{n+1}$,

$$
\begin{aligned}
& m=\frac{1}{q-1}\left[n g^{n}-\left(1+q+q^{2}+\ldots+q^{n-2}+q^{n-1}\right)\right]=\frac{1}{q-1}\left(n q^{n}-\frac{q^{n}-1}{q-1}\right)= \\
& =\frac{n q^{n+1}-(n+1) q^{n}+1}{(q-1)^{2}}=\frac{n \cdot 7^{n+1}-(n+1) 7^{n} \cdot 6+6^{n+1}}{6^{n-1}}=\frac{7^{n}(n-6)}{6^{n-1}}+6^{2}
\end{aligned}
$$

The first term of the last form must be an integer. Since $7^{n}$ and $6^{n-1}$ are relatively prime, therefore

$$
\frac{n-6}{6^{n-1}}
$$

must be an integer. However, here the numerator is less than the denominator, indeed $n-1>0$, and thus

$$
6^{n-1}-1=(6-1)\left(6^{n-2}+6^{n-3}+\ldots+6+1\right) \geq 5 \cdot(n-1)
$$

(by replacing each term in the parentheses with 1). From this

$$
6^{n-1} \geq 1+5(n-1)>n-1
$$

On the other hand, $n$ is at least 6, since on the $n$-1-th day, 6 times the number of coins left after distributing $n-1$ coins (which must also be an integer) is a multiple of $n$. The number (3) is therefore non-negative, less than 1, and an integer, so it must be 0. According to this, $n=6$, and the number of coins can only be 36 according to (2). This also fits, because then the number of coins distributed on the respective days is

$$
\begin{gathered}
1+\frac{36-1}{7}=6, \quad 2+\frac{36-6-2}{7}=6, \quad 3+\frac{36-2 \cdot 6-3}{7}=6 \\
4+\frac{36-3 \cdot 6-4}{7}=6, \quad 5+\frac{36-4 \cdot 6-5}{7}=6 \quad \text { and } \quad 36-5 \cdot 6=6
\end{gathered}
$$

II. solution. Let's find a relationship between the number of coins distributed on two consecutive days. With the above notation, from (1),

$$
d_{k}=\frac{m_{k}}{7}+\frac{6}{7} k, \quad \text { so } \quad d_{k-1}=\frac{m_{k-1}}{7}+\frac{6}{7} k-\frac{6}{7}
$$

from these

$$
\begin{gathered}
d_{k-1}-d_{k}=\frac{m_{k-1}-m_{k}}{7}-\frac{6}{7}=\frac{d_{k-1}}{7}-\frac{6}{7} \\
d_{k-1}=\frac{7}{6} d_{k}-1
\end{gathered}
$$

Now $d_{n}=n$, so $d_{n-1}=\frac{7}{6} n-1$, and this is an integer, so $n$ is divisible by 6. Since $n>1$, therefore $n \geq 6$. Let's denote the non-negative $n-6$ number by $\alpha$, so from (4),

$$
\begin{gathered}
d_{n-1}=\frac{7}{6}(\alpha+6)-1=\frac{7}{6} \alpha+6 \\
d_{n-2}=\left(\frac{7}{6}\right)^{2} \cdot \alpha+6, \ldots, d_{1}=\left(\frac{7}{6}\right)^{n-1} \cdot \alpha+6
\end{gathered}
$$

$d_{1}$ can only be an integer if $\alpha=n-6$ is divisible by $6^{n-1}$. This is only possible if $\alpha=0$, since

$$
\alpha=n-6<n-1<1+6 \ldots+6^{n-2}=\frac{6^{n-1}-1}{6-1}<6^{n-1}
$$

thus the solution: $\alpha=0, n=6, d_{1}=d_{2}=\ldots=d_{6}=6$, and $m=36$.