Let $f\left(x,y\right)=x^2\left(\left(x+2y\right)^2-y^2+x-1\right)$. If $f\left(a,b+c\right)=f\left(b,c+a\right)=f\left(c,a+b\right)$ for distinct numbers $a,b,c$, what are all possible values of $a+b+c$?

[i]2019 CCA Math Bonanza Individual Round #12[/i]
1. Given the function \( f(x, y) = x^2 \left( (x + 2y)^2 - y^2 + x - 1 \right) \), we need to find the possible values of \( a + b + c \) given that \( f(a, b+c) = f(b, c+a) = f(c, a+b) \) for distinct numbers \( a, b, c \).

2. Let \( k = a + b + c \). We start by evaluating \( f(a, k-a) \):
   \[
   f(a, k-a) = a^2 \left( (a + 2(k-a))^2 - (k-a)^2 + a - 1 \right)
   \]
   Simplifying inside the parentheses:
   \[
   a + 2(k-a) = 2k - a
   \]
   \[
   (2k - a)^2 = 4k^2 - 4ak + a^2
   \]
   \[
   (k-a)^2 = k^2 - 2ak + a^2
   \]
   Therefore:
   \[
   f(a, k-a) = a^2 \left( (4k^2 - 4ak + a^2) - (k^2 - 2ak + a^2) + a - 1 \right)
   \]
   \[
   = a^2 \left( 4k^2 - 4ak + a^2 - k^2 + 2ak - a^2 + a - 1 \right)
   \]
   \[
   = a^2 \left( 3k^2 - 2ak + a - 1 \right)
   \]

3. Similarly, we evaluate \( f(b, c+a) \) and \( f(c, a+b) \):
   \[
   f(b, c+a) = b^2 \left( (b + 2(c+a))^2 - (c+a)^2 + b - 1 \right)
   \]
   \[
   f(c, a+b) = c^2 \left( (c + 2(a+b))^2 - (a+b)^2 + c - 1 \right)
   \]

4. Since \( f(a, k-a) = f(b, c+a) = f(c, a+b) \), we can equate the simplified forms:
   \[
   a^2 (3k^2 - 2ak + a - 1) = b^2 (3k^2 - 2bk + b - 1) = c^2 (3k^2 - 2ck + c - 1)
   \]

5. Define \( f(x) = x^2 (3k^2 - 2kx + x - 1) \). By Vieta's formulas, the sum of the roots \( a, b, c \) of the polynomial \( f(x) \) is given by:
   \[
   \frac{3k^2 - 1}{-2k + 1} = a + b + c = k
   \]

6. Solving the equation:
   \[
   3k^2 - 1 = 2k^2 + k
   \]
   \[
   k^2 - k - 1 = 0
   \]

7. Using the quadratic formula \( k = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \) where \( a = 1 \), \( b = -1 \), and \( c = -1 \):
   \[
   k = \frac{1 \pm \sqrt{1 + 4}}{2} = \frac{1 \pm \sqrt{5}}{2}
   \]

8. Therefore, the possible values of \( a + b + c \) are:
   \[
   k = \frac{1 + \sqrt{5}}{2} \quad \text{or} \quad k = \frac{1 - \sqrt{5}}{2}
   \]

The final answer is \( \boxed{\frac{1 \pm \sqrt{5}}{2}} \)