
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 that all terms are positive in the geometric sequence $\{a_n\}$, the sum of the first $n$ terms is $S_n$, and the general formula for the sequence $\{b_n\}$ is $b_n=\begin{cases}n, & \text{for even } n \\ n+1, & \text{for odd } n\end{cases} \left(n\in\mathbb{N}^*\right)$. If $S_3=b_5+1$ and $b_4$ is the geometric mean of $a_2$ and $a_4$.

$(1)$ Find the general formula for the sequence $\{a_n\}$;

$(2)$ Find the sum of the first $n$ terms $T_n$ of the sequence $\{a_n\cdot b_n\}$.

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