
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 the sequence $\{a_n\}$ is an arithmetic sequence with $a_1=2$, and the sum of the first $n$ terms of $\{a_n\}$ is $S_n$. The sequence $\{b_n\}$ is a geometric sequence, and it holds that $a_1b_1+a_2b_2+a_3b_3+\ldots+a_nb_n=(n-1)\cdot2^{n+2}+4$ for any $n\in\mathbb{N}^*$. 

$(1)$ Find the general formula for the sequences $\{a_n\}$ and $\{b_n\}$.

$(2)$ Does there exist a non-zero integer $\lambda$ such that the inequality $\sin \frac{a_n\pi}{4} < \frac{1}{\lambda\left(1- \frac{1}{a_1}\right)\left(1- \frac{1}{a_1}\right)\ldots\left(1- \frac{1}{a_n}\right) \sqrt{a_n+1}}$ holds for all $n\in\mathbb{N}^*$? If it exists, find the value of $\lambda$; if not, explain why.

$(3)$ For an infinite arithmetic sequence $\{c_n\}$ whose terms are all positive integers, satisfying $c_{39}=a_{1007}$, and there exists a positive integer $k$ such that $c_1$, $c_{39}$, and $c_k$ form a geometric sequence. If the common difference of the sequence $\{c_n\}$ is $d$, find the sum of all possible values of $d$.

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