<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] Your $U_n$ satisfy the nonhomogeneous equation $3U_{n+1} - 2{U_n} = -1$. The standard technique to solve such an equation explicitly is to shift the index by one to get $3U_{n+2} - 2U_{n+1} = -1$ and subtract both equations. Then we get that $U_n$ satisfies
$$ 3U_{n+2} - 5U_{n+1} + 2U_n = 0. $$
This is a second order homogeneous equation for $U_n$ which can be solved by the methods available for homogeneous equations. Let's guess a solution of the form $U_n = r^n$. Then
$$ 3r^{n+2} - 5r^{n+1} + 2r^n = r^n(3r^2 - 5r + 2) = 0. $$
To get non-trivial solutions, we must have $3r^2 - 5r + 2 = 0$ which implies that $r = 1$ or $r = \frac{2}{3}$. Hence the general solution to this equation is given by
$$ U_n = A + B \left( \frac{2}{3} \right) ^n $$
where $A,B$ are arbitrary constants. Since $U_0 = 2$, we get $A + B = 2$. Since $U_1 = \frac{2}{3}U_0 - 1 = \frac{1}{3}$, we get $A + \frac{2B}{3} = \frac{1}{3}$. Hence, $B = 5$ and $A = -3$ so
$$ U_n = -3 + 5 \left( \frac{2}{3} \right)^n. $$
</s>