Write three approximations of the sequence ${x_n} = {1/ 3^n}$, using the following scheme -
$P_0= 1, P_1 = 0.33332$ and $P_n = (6/5)P_{n-1} - (1/5)P_{n-2}$
for $n = 2, 3,\dots$
Further, make a table of errors for each of the three approximations in the following format for first ten errors
n |xn-Pn|
0
1
.
.
.
10
I am not sure of the purpose of the exercise as none of the three items approximate the sequence, but here goes.
This is a just a straight plug in values and take differences for each $n$ for the four quantities.
Following this, we can setup the table and arrive at:
$$\left( \begin{array}{cccc} \text{n} & \text{$|$x$\_$n - r$\_$n$|$} & \text{$|$x$\_$n - p$\_$n$|$} & \text{$|$x$\_$n - q_n$|$} \\ 0 & 0.00004 & 0. & 0. \\ 1 & 0.133341 & 0.0000133333 & 0.133336 \\ 2 & 0.0711127 & 0.0888729 & 0.0711267 \\ 3 & 0.0290374 & 0.13628 & 0.0291152 \\ 4 & 0.0107457 & 0.155638 & 0.0111363 \\ 5 & 0.00379524 & 0.162801 & 0.00574835 \\ 6 & 0.00130774 & 0.165332 & 0.0110734 \\ 7 & 0.000444448 & 0.166203 & 0.0492726 \\ 8 & 0.000149856 & 0.1665 & 0.24429 \\ 9 & 0.0000502933 & 0.1666 & 1.22075 \\ 10 & 0.0000168327 & 0.166633 & 6.10353 \\ \end{array} \right)$$
Now, you just have to write a program that outputs this table.