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$ ?


 A: 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. $$
A: This recurrence is of the form $U_{n+1}=\alpha U_n-1$. 
Let $V_n:=U_n-c$, so $V_{n+1}+c=\alpha V_n+\alpha c-1$. Now solve solve $c=\alpha c -1$, which gives $c=-\frac{1}{1-\alpha}=-3$. This gives $V_{n+1}=\alpha V_n$, which can easily be solved to give $V_{n}=\alpha^n V_0$, where $V_0=5$. So:
$$U_n=V_n+c=\alpha^n V_0+c=(2/3)^n5-3.$$
A: 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}
$$
A: Note that $U_0=2$, $U_1=1/3$, and 
$$
U_{n}-U_{n-1}=\frac{2}{3}(U_{n-1}-U_{n-2})=\cdots=\left(\frac{2}{3}\right)^{n-1}(U_1-U_0)=-5\,\frac{2^{n-1}}{3^n}.
$$
Similarly
$$
U_{n-1}-U_{n-2}=-5\,\frac{2^{n-2}}{3^{n-1}}, 
$$
$$
\cdots
$$
$$
U_{1}-U_{0}=-\frac{5}{3}.
$$
Summing all the identities we obtain
$$
U_n-U_0=-\frac{5}{3}\sum_{i=0}^{n-1}\left(\frac{2}{3}\right)^i\implies U_n=-3+5\left(\frac{2}{3}\right)^n.
$$
A: From the given
$$U_{n+1}+3=\frac{2}{3}\left(U_n+3\right).$$
Also we have $U_0+3=5$.
Thus, $$U_n+3=5\left(\frac{2}{3}\right)^n,$$
which gives
$$U_n=5\left(\frac{2}{3}\right)^n-3.$$
Done!
A: Any sequence of the form
$$f_n=Af_{n-1}+B$$
can be expressed as a generalized Fibonacci sequence
$$f_n=af_{n-1}+bf_{n-2}$$
where $a=A+1$ and $b=-A$, by incrementing the original sequence and subtracting to eliminate $B$. Once this is done we can develop a general solution for $f_n$ in terms of $A,B,f_0$ as described below.
There have been many extensions of the sequence with adjustable (integer) coefficients and different (integer) initial conditions, e.g., $f_n=af_{n-1}+bf_{n-2}$. (You can look up Pell, Jacobsthal, Lucas, Pell-Lucas,  and Jacobsthal-Lucas sequences.) Maynard has extended the analysis to $a,b\in\mathbb{R}$, (Ref: Maynard, P. (2008), “Generalised Binet Formulae,” $Applied \ Probability \ Trust$; available at http://ms.appliedprobability.org/data/files/Articles%2040/40-3-2.pdf.)
We have extended Maynard's analysis to include arbitrary $f_0,f_1\in\mathbb{R}$. It is relatively straightforward to show that
$$f_n=\left(f_1-\frac{af_0}{2}\right) \frac{\alpha^n-\beta^n}{\alpha-\beta}+\frac{af_0}{2} \frac{\alpha^n+\beta^n}{\alpha+\beta}=\frac{(f_1-f_0\beta)\alpha^n-(f_1-f_0\alpha)\beta^n}{\alpha-\beta}$$
where $\alpha,\beta=(a\pm\sqrt{a^2+4b})/2$. This can also be expressed in various other forms.
Now, specializing to the sequence $f_n=Af_{n-1}+B$, we find the general solution for all such sequences that $\alpha=A$, $\beta=1$ and
$$f_n=\frac{[(A-1)f_0+B)A^n-B}{A-1}$$
This solution has been tested numerically against the original sequence for randomly chosen $A,B,f_0\in[-3,3]$ and is in perfect agreement.
