Is there a solution for this recurrence relation?

94 Views Asked by At

Let $a_n=\begin{cases} \frac{n+1}{3}, & n\equiv 2 \pmod 3 \\ a_{\lfloor\frac{n+1}{3}\rfloor}, & \text{else} \end{cases}$ for all integer $n\geq1$, where $a_0=0$.

Is there a closed form for $a_n$?

Thank in advances.

1

There are 1 best solutions below

0
On

I couldnt figure out any getaround except this :

Write the number as:

$$3^n\delta_n+3^{n-1}\delta_{n-1}+...\delta_0$$ where all $\delta$'s $<3$

Make a walk from $\delta_0$ to $\delta_n$

If any $\delta$ crossed through = 2 the result is what is behind otherwise it is 0

It does mean, if $\delta_k=2$ then the result is $3^{n-k-1}\delta_n+....+\delta_{k+1}$