
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 \( n \) be a positive integer. Given a real number \( x \), let \( \lfloor x \rfloor \) be the greatest integer less than or equal to \( x \). For example, \( \lfloor 2.4 \rfloor = 2 \), \( \lfloor 3 \rfloor = 3 \), and \( \lfloor \pi \rfloor = 3 \). Define a sequence \( a_1, a_2, a_3, \ldots \) where \( a_1 = n \) and
\[ 
a_m = \left\lfloor \frac{a_{m-1}}{3} \right\rfloor,
\]
for all integers \( m \geq 2 \). The sequence stops when it reaches zero. The number \( n \) is said to be lucky if 0 is the only number in the sequence that is divisible by 3. For example, 7 is lucky, since \( a_1 = 7, a_2 = 2, a_3 = 0 \), and none of 7, 2 are divisible by 3. But 10 is not lucky, since \( a_1 = 10, a_2 = 3, a_3 = 1, a_4 = 0 \), and \( a_2 = 3 \) is divisible by 3. Determine the number of lucky positive integers less than or equal to 1000.

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