
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 the sequence \{a_n\} have a sum of the first n terms denoted by S_n. Given that a_1 = \frac{4}{5}, and a_{n+1} = \begin{cases} 2a_n, & 0\leqslant a_n\leqslant \frac{1}{2} \\ 2a_n-1, & \frac{1}{2} < a_n\leqslant 1\end{cases}, calculate the value of S_{2018}.

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