
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 $n$ be an integer greater than 2. Define $a_{n}$ as the largest $n$-digit number that is neither the sum nor the difference of two perfect squares.
1. Find $a_{n}$ as a function of $n$.
2. Determine the smallest value of $n$ such that the sum of the squares of the digits of $a_{n}$ is a perfect square.

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