28. Two brothers sold a flock of sheep that belonged to both of them, taking as many rubles for each sheep as there were sheep in the flock. The money received was divided as follows: first, the elder brother took ten rubles from the total amount, then the younger brother took ten rubles, after that the elder brother took another ten rubles, and so on. In the end, the younger brother did not have enough ten rubles; therefore, he took all the small change left after the division, and in addition, to make the division fair, the elder brother gave the younger brother his pocket knife. What was the pocket knife valued at?
28. Let the number of sheep in the flock be denoted by $n$; in this case, the brothers received $n$ rubles for each sheep, and thus the total amount they received is $N=n \cdot n=n^{2}$ rubles. Let $d$ be the number of whole tens in the number $n$, and $e$ be the number of units; then $n=10 d+e$ and

$$
N=(10 d+e)^{2}=100 d^{2}+20 d e+e^{2}
$$

From the conditions of the division, it follows that the elder brother received one ten more than the younger brother, i.e., that the total sum $N$ contains an odd number of tens (and some remainder). But $100 d^{2}+20 d e=20 d(5 d+e)$ is divisible by 20 (contains an even number of tens); therefore, the number $e^{2}$ must contain an odd number of tens. Since $e$ is less than 10 ( $e$ is the remainder of the division of the number $n$ by 10 ), then $e^{2}$ can only have one of the following values:

$$
1,4,9,16,25,36,49,64,81
$$

But of these numbers, only 16 and 36 contain an odd number of tens; therefore, $e^{2}$ is equal to 16 or 36. Both these numbers end in 6; hence, the remainder that the younger brother received in place of the 10 rubles he was short is 6 rubles, and the elder received 4 rubles more than the younger. Therefore, for the division to be fair, the elder should still pay the younger 2 rubles. Thus, the pocketknife was valued at 2 rubles.