A subset of k elements of $\{1,2,\cdots, 2022\}$ is chosen at random. Prove that the probabilities that the sum of the elements of the chosen subset is congruent to 0,1,2 mod 3 are equal iff $k\equiv 1,2\mod 3$.
Generating functions could be useful for counting such sums. Let $\omega$ be a primitive cube root of unity. It could be useful to find a generating function that uses $\omega$ somehow and then find the coefficient of $x^k$ of this function. But I'm not sure how to find the coefficient of $x^k$. Perhaps finding this coefficient in at least 2 different ways could allow for some useful deductions about k?
First, the generating function approach doesn't quite work. The problem is that you don't take into account that the $k$ numbers must be distinct. Here's an alternative: partition $\{1, 2, \ldots, 2022\}$ into the $3$-sets of the form: $$\{1, 2, 3\}, \{4, 5, 6\}, \ldots, \{2020, 2021, 2022\}$$ where each of them is of the form $\{3k-2, 3k-1, 3k\}$, where $1 \leqslant k \leqslant \tfrac{2022}{3}$. For any $k$-subset that you pick, you can get other $k$-subsets by permuting the elements in each partition. For instance, the $5$-subset $\{1, 2, 3, 4, 5, 7\}$ could become $\{1, 2, 3, 5, 6, 9\}$. If your original $k$-subset only contained any of the partitions partially, then you can show that permuting that partition induces a bijection between the subsets with sums $0, 1, 2 \bmod{3}$. For instance, say you pick only $1$ in $\{1, 2, 3\}$. Replacing it with each of $1, 2, 3$ will give you all possible sums modulo $3$ equally.
If $k \equiv 1, 2 \bmod{3}$, then any $k$-subset must choose partially from some partition (every partition has size $3$, so if $k$ was a disjoint union of partitions, then $3 \mid k$), and the above argument shows that the number of subsets with sum of each residue class modulo $3$ are equal.
On the other hand, if $k \equiv 0 \bmod{3}$, the same argument gives you equal number of subsets which have sums $0, 1, 2 \bmod{3}$, with the exception that you must consider the $k$-subsets which are disjoint unions of partitions. Since each partition has sum divisible by $3$, all these $k$-subsets have sum being $0 \bmod{3}$. Thus, you get more subsets with sum $0 \bmod{3}$ than sum $1, 2 \bmod{3}$.