8.2. Several integers are written on the board. Petya replaced each number (by erasing it) as follows: he wrote down half of it if it was even, and doubled it if it was odd. Could the sum of the new numbers be equal to the sum of the original numbers if the sum of the original numbers was a) 2021; b) 2022?
Answer: a) could not. b) could. Let $A$ be the initial sum of even numbers on the board, and $B$ be the sum of odd numbers, and let $n=A+B$. Then we have the equation $\frac{A}{2}+2 B=A+B \Leftrightarrow A=2 B$. Therefore, the sum on the board should be $A+B=3 B=n$. In case a) $n=2021$, and this leads to a contradiction with divisibility by 3. In case b), when $n=2022$, an example can be given: on the board are written two numbers $a=1348$ and $b=674$.