
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
If a right triangle has three sides that are pairwise coprime positive integers, such a right triangle is called a primitive right triangle.
(1) Find the number of primitive right triangles whose area is exactly equal to $n$ times their perimeter and denote this number by $a_n$;
(2) Find $\max _{1 \leqslant n \leqslant 2023} a_n$, and list all primitive right triangles whose area is exactly equal to 2023 times their perimeter.

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