Subsets - is it possible or not? This question is taken from a coding practice problem.
Given $n$ numbers, you can perform the following operation any number of times : Choose any subset of the numbers (possibly empty), none of which are $0$. Decrement the numbers in the subset by $1$, and increment the numbers not in the subset by $K$.
Is it possible to perform operations such that exactly $n - 1$ numbers become $0$? 
 A: Let $(a_{rk})_{1\le r\le n}$ be the set of numbers in the $k$-th step of the game, and let $S_k\subseteq[n]$ be the set of numbers which are chosen in the $k$-th step. Then by definition, $a_{r(k+1)}=a_{rk}-1$ if $r\in S_k$ and $a_{r(k+1)}=a_{rk}+K$ otherwise.
Now define $b_{rk}=(a_{rk}+k)\bmod (K+1)$. Then if $r\in S_k$,
$$b_{r(k+1)}=(a_{rk}-1+k+1)\bmod (K+1)=(a_{rk}+k)\bmod (K+1)=b_{rk}$$
and if $r\notin S_k$,
$$b_{r(k+1)}=(a_{rk}+K+k+1)\bmod (K+1)=(a_{rk}+k)\bmod (K+1)=b_{rk}$$
so the $b_{rk}=b_r$ are invariant under any number of moves of the game. Since in the final state of the game, $b_r=k\bmod (K+1)$ is the same for $n-1$ of the positions, any solvable game must have, if you evaluate $b_{rk}$ in the initial state, that at least $n-1$ of them are the same.
This gives a necessary, but maybe not sufficient, condition for the game to be solvable.
A minimal unsolvable game: $K=2$, $n=3$, $\langle a_{r1}\rangle=\langle1,2,3\rangle$.
Edit: Actually, this is a sufficient condition as well. Suppose we know, as stated above, that all except one of them (let's call this one $R$) has equal $b_r$. Let $T=[n]\setminus\{R\}$ (which is to say, the set of all indexes except for $R$). These are the indexes we will try to force to $0$ (and $R$ is the unlucky one left out). Our algorithm is to select on step $k$ the set $S_k=\{r\in T\mid \forall s\in T\ a_{sk}\le a_{rk}\}$, that is, the set of all maximal $a_{rk}$ (except $a_{Rk}$, which we don't care about). If in step $1$ the maximum element in $T$ has value $m$, we will finish in step $m+1$.
The reason is because in each step, the maximum elements in $T$ go down by $1$, and I claim that the maximum value of all elements in $T$ also goes down by $1$. Clearly this depends on the non-maximal elements not shooting past the current maximal elements when they go up by $K$, but this follows from the assumption that $b_r$ is the same for all $r\in T$: this means that for any $r,s\in T$, $a_{rk}\equiv a_{sk}\pmod{K+1}$, so if $a_{sk}<a_{rk}$, then $a_{rk}-a_{sk}\ge K+1$, so the non-maximal elements will go up by $K$ and the maximal elements will go down by $1$, but since the non-maximal elements are at least $K+1$ less than the maximal ones, they will not exceed the new maximum, so as a result the maximum over all elements in $T$ goes down by $1$.
This essentially completes the proof. After each step, the maximum goes down by $1$ until it is $0$ and we are done.
As an example of the operation of the algorithm, let's use the OP's original example, with $K=2$ and $\langle a_{r1}\rangle=\langle2,3,5\rangle$: First we identify the odd one out. $\langle b_r\rangle=\langle0,1,0\rangle$, so the game is solvable (since all but one is $0$), and $R=2$. Thus we should be done on step 6.
$$\begin{array}[lll]{}
\langle a_{r1}\rangle=\langle2,3,5\rangle & \quad & S_1=\{3\} \\
\langle a_{r2}\rangle=\langle4,5,4\rangle & \quad & S_2=\{1,3\} \\
\langle a_{r3}\rangle=\langle3,7,3\rangle & \quad & S_3=\{1,3\} \\
\langle a_{r4}\rangle=\langle2,9,2\rangle & \quad & S_4=\{1,3\} \\
\langle a_{r5}\rangle=\langle1,11,1\rangle & \quad & S_5=\{1,3\} \\
\langle a_{r6}\rangle=\langle0,13,0\rangle
\end{array}$$
(Note that if the initial condition contains negative numbers, this algorithm should be preceded by a "waiting" period where $S_k=\emptyset$ is repeatedly selected until all numbers are nonnegative.)
