
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

Let $a_n$ be the number of permutations $\left(k_1, k_2, \ldots, k_n\right)$ of the numbers $(1,2, \ldots, n)$ such that the following two conditions are satisfied:

- $k_1=1$
- For any index $i=1,2, \ldots, n-1$, the inequality $\left|k_{i}-k_{i+1}\right| \leq 2$ holds.

What is the value of $a_n$?

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