<s>[INST] Obtaining an explicit expression of $U_n$ given by $U_{n+1}=\frac{2}{3}U_n -1$ and $U_0=2$ 
Let $(U_n)_n\geq 0$ be the sequence defined by: $$U_0=2\qquad, U_{n+1}=\frac{2}{3}U_n -1\quad\text{for all } n \geq 0$$ .

My question Here is : How do I write  $U_n$ with a function of $n$ ?


 [/INST] You can use the method of generating functions. Let $U(x)=\sum_{n=0}^\infty U_n x^n$. We wish to solve the recurrence
$$
U_{n+1}=\frac{2}{3}U_n -1;\quad (n\geq0)\tag{1}
$$
where $U_0=2$. Multiply both sides of (1) by $x^n$ and sum on $n$ to get that
$$
\frac{U(x)-2}{x}=\frac{2}{3}U(x)-\frac{1}{1-x}.\tag{2}
$$
Solve for $U(x)$ and use partial fractions to get that
$$
U(x)
=\frac{2-3x}{(1-x)(1-(2/3)x)}
=\frac{-3}{1-x}+\frac{5}{1-(2/3)x}
=\sum_{n=0}^\infty(-3+5(2/3)^n)x^n
\tag{3}
$$
Hence
$$
U_{n}=-3+5\left(\frac{2}{3}\right)^n;\quad (n\geq0).
\tag{4}
$$
</s>