
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_1, a_2, a_3, \ldots$  be an infinite sequence of positive integers such that  $a_1=4$ ,  $a_2=12$ , and for all positive integers  $n$ , \[a_{n+2}=\gcd\left(a_{n+1}^2-4,a_n^2+3a_n \right).\] Find, with proof, a formula for  $a_n$  in terms of  $n$ .

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