
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
In the sequence $\{a_{n}\}$, $a_{2}=2$, $a_{3}+a_{7}=10$, and $a_{n+1}=2a_{n}-a_{n-1}$ for $n\geqslant 2$.  
$(1)$ Find the general formula for the sequence $\{a_{n}\}$.  
$(2)$ In the sequence $\{a_{n}\}$, let $b_{k}$ be the number of terms satisfying $k\leqslant a_{n}\leqslant 2^{k}$, where $k$ is a positive integer. Find the sum of the first $k$ terms of the sequence $\{b_{k}\}$ denoted by $T_{k}$.

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