7,8 |

Petya plans to spend all 90 days of his vacation in the village and during this time, he will go swimming in the lake every second day (i.e., every other day), go to the store for groceries every third day, and solve math problems every fifth day. (On the first day, Petya did the first, second, and third activities and got very tired.) How many "pleasant" days will Petya have, when he needs to go swimming but does not need to go to the store or solve math problems? How many "boring" days will he have, when he has no activities at all?
Let's number the days from 0 to 89. Petya swims on days with even numbers, goes to the store on days with numbers divisible by 3, and solves problems on days with numbers divisible by 5.

Thus, we need to answer two questions:

1) How many even numbers from 0 to 89 are not divisible by 3 or 5?
2) How many odd numbers from 0 to 89 are not divisible by 3 or 5?

The answers to these questions are the same. Indeed, let's divide our numbers into pairs with a difference of 45: $\{0,45\},\{1, 46\}, \ldots,\{44,89\}$. In each pair, there are two numbers of different parity, and if one number in the pair is not divisible by 3 or 5, then the other is also not divisible by 3 or 5.

Therefore, it is sufficient to answer question 1).

Notice that there are exactly half as many even numbers from 0 to 89, which is 45. Out of these, every third number is divisible by 3 (a total of 15 numbers), every fifth number is divisible by 5 (9 numbers), and every fifteenth number is divisible by 15 (3 numbers). Thus, the number of even numbers divisible by either 3 or 5 is $15+9-3=21$ (we subtract 3 because the numbers divisible by 15 are counted twice in the sum $15+9$). Therefore, the number of numbers of interest to us is $45-21=24$.

Author: $\underline{\text { Vasyev N.E. }}$.

Let $k$ and $n$ be natural numbers, $k \leq n$. Arrange the first $n^{2}$ natural numbers in an $n \times n$ table such that the numbers in each row are in increasing order, and the sum of the numbers in the $k$-th column is a) the smallest; b) the largest.

## Solution

a) Example. If the numbers are arranged as shown in the table - first fill the first $k$ columns, row by row, with numbers from 1 to $k n$, and then fill the remaining $n-k$ columns with the remaining numbers (in any order, as long as the condition of increasing numbers in each row is satisfied) - then the sum of the numbers in the $k$-th column will be equal to $1 / 2 k n(n+1)$.

$$
\begin{array}{|rrrr|r|rr|}
\hline 1 & 2 & \cdots & k-1 & k \\
k+1 & k+2 & \cdots & 2 k-1 & 2 k & & \\
2 k+1 & 2 k+2 & \cdots & 3 k-1 & 3 k & & \\
\cdots & \cdots & \cdots & \cdots & & \\
(n-1) k+1 & \ldots & \cdots & n k-1 & n k & \ldots & n^{2} \\
\hline
\end{array}
$$

Estimate. Let $a_{1}, a_{2}, \ldots, a_{n}$ be the numbers in the $k$-th column, numbered in increasing order: $a_{1}<a_{2}<\ldots<a_{n}$. Consider the numbers in the same rows as $a_{1}, a_{2}, \ldots, a_{i}$ and in the first $k$ columns. These $k i$ numbers do not exceed $a_{i}$, so $a_{i} \geq k i$ for $i=1,2, \ldots, n$. Summing these inequalities, we get

$a_{1}+a_{2}+\ldots+a_{n} \geq 1 / 2 k n(n+1)$.

b) Replace each number $a$ in the table with ($n^{2}+1-a$) and then reverse the order of the numbers in each row. Clearly, this is a one-to-one transformation of the set of tables of numbers $1,2, \ldots, n^{2}$ that satisfy the condition of the problem. Under this transformation, each number in the $k$-th column of the new table $A^{\prime}$ is equal to the number in the same row and in the ($n+1-k$)-th column of the old table $A$; therefore, the sum of the numbers in the $k$-th column of the table $A^{\prime}$ is $n\left(n^{2}+1\right)-S$, where $S$ is the sum of the numbers in the ($n+1-k$)-th column of $A$. Thus, it is sufficient to solve part a) for the column with number $n+1-k$. Consequently, the maximum sum in the $k$-th column is $n\left(n^{2}+1\right)-1 / 2(n+1-k) n(n+1)=1 / 2 n\left((n-1)^{2}+k(n+1)\right)$

## Answer

a) $1 / 2 k n(n+1) ; \quad$ b) $1 / 2 n\left((n-1)^{2}+k(n+1)\right)$.