Each pan of a balance has k weights, numbered from 1 to k. The left pan is heavier. It turns out that if we interchange the places of any two weights with the same number, then either the right pan becomes heavier or the two pans reach an equilibrium. For what k this is possible? Please provide the sum of all possible values of k.

Let's think step by step and output the final answer within \boxed{}.
user