
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Given $f(x) = |x-2017| + |x-2016| + \ldots + |x-1| + |x+1| + \ldots + |x+2017| \, (x \in \mathbb{R})$, and it satisfies $f(a^2-3a+2) = f(a-1)$ for integer $a$ with a total of $n$ such integers. Let $g(x) = \frac{x^2(x^2+k^2+2k-4)+4}{(x^2+2)^2-2x^2}$ have a minimum value of $m$, and $m+n=3$, then the value of the real number $k$ is \_\_\_\_\_\_.

Present the answer in LaTex format: \boxed{Your answer}
user