Let it be $A=\{a_0,...,a_n\}$, $B=\{b_0,...,b_j\}$ and $C=\{c_0,...,c_k\}$ three sets of equal or distinct integers, not necessarily ordered, each set having at least two values other than $0$. I am having troubles to find "interesting" conditions on the elements of these sets for this equality to hold:
$$\frac{\left(\sum_{i=0}^{n}ia_{i}\right)}{\left(\sum_{i=0}^{n}a_{i}\right)}=\frac{\left(\sum_{i=0}^{j}ib_{i}\right)}{\left(\sum_{i=0}^{j}b_{i}\right)}+\frac{\left(\sum_{i=0}^{k}ic_{i}\right)}{\left(\sum_{i=0}^{k}c_{i}\right)}$$
I derived that this equality is true if $$\sum_{i=0}^{n}a_{i}=\left(\sum_{i=0}^{j}b_{i}\right)\left(\sum_{i=0}^{k}c_{i}\right)$$ and $$\sum_{i=0}^{n}ia_{i}=\left(\sum_{i=0}^{k}c_{i}\right)\left(\sum_{i=0}^{j}ib_{i}\right)+\left(\sum_{i=0}^{k}ic_{i}\right)\left(\sum_{i=0}^{j}b_{i}\right)$$
An example of what I am looking for: If $\sum_{i=0}^{n}a_{i}$ is some prime number $\pm p$, then necessarily $\left(\sum_{i=0}^{j}b_{i}\right)=\pm 1$, $\left(\sum_{i=0}^{k}c_{i}\right)=\pm p$ and $\sum_{i=0}^{n}a_{i}$ divides $\left(\sum_{i=0}^{j}ib_{i}\right)$, or $\left(\sum_{i=0}^{k}c_{i}\right)=\pm 1$, $\left(\sum_{i=0}^{j}b_{i}\right)=\pm p$ and $\sum_{i=0}^{n}a_{i}$ divides $\left(\sum_{i=0}^{k}ic_{i}\right)$, which is only possible if some $b_i$ or $c_j$ is negative.
I have not been able to find any other meaningful insights. I would appreciate any hint or help.
Thanks in advance!
Edit
After @mathlove 's nice counterexample to the first equation, I want to clarify that it is derived from the second and the third ones; so ideally, I would want to find "interesting" conditions on the elements of the sets for the three equalities to hold.
If one generalizes your sum with $z$ as: $$ \sum_{i=0}^n a_i \: z^i = Q(n,z) \\ \sum_{i=0}^j b_i \: z^i = R(j,z) \\ \sum_{i=0}^k c_i \: z^i = S(k,z)$$ and $$ Q(n,z) = R(j,z) \cdot S(k,z) $$ then it is quite easy to see that taking the logarithmic derivative of each side and then multiplying by $z$ will give you: $$ z\frac{\frac{d}{dz}Q(n,z)}{Q(n,z)} = z\frac{\frac{d}{dz}R(j,z)}{R(j,z)} + z\frac{\frac{d}{dz}S(k,z)}{S(k,z)} $$ Setting $z = 1$ yields: $$ \frac{\sum_{i=0}^n i \cdot a_i}{\sum_{i=0}^n a_i } = \frac{\sum_{i=0}^j i \cdot b_i}{\sum_{i=0}^j b_i} + \frac{\sum_{i=0}^k i \cdot c_i}{\sum_{i=0}^k c_i} $$
Your second identity is just the derivative without taking the logarithm. Any "special" characteristics will come from the original equation. It may interest you to look into multiplicative functions, where $$ f(a\cdot b) = f(a)f(b)$$ when $a$ and $b$ are coprime.