
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 a sequence $\{a_n\}$ with the sum of its first $n$ terms denoted as $S_n$. It is known that $a_1 = \frac{4}{5}$ and $a_{n+1}$ is defined as follows:
$$
a_{n+1} =
\begin{cases}
2a_n, & 0 \leq a_n \leq \frac{1}{2}, \\
2a_n - 1, & \frac{1}{2} < a_n \leq 1.
\end{cases}
$$
Determine the value of $S_{2018}$ and choose the correct answer from the options below:
A) $\frac{5044}{5}$
B) $\frac{5047}{5}$
C) $\frac{5048}{5}$
D) $\frac{5049}{5}$

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