# Thread: Real sequence

1. ## Real sequence

Hello, I want some help writing a matlab script.
x(n+1) = (x(n))^3-a*x(n) is my real sequence
The script should read in the value of a and the value x1.
I achieved to do that.
It should then carry out a large number of iterations, without printing the results, to bypass the short-term, transient behaviour, and then print out on the screen a moderate number of further iterations.
I don't know how to do this part.
The script should also display the results in a graphical way. This I can do it after finding a way to do the above part.

Any help is appreciated, thank you very much!

2. The 'recursive relation' defining the sequence can be written as...

$\displaystyle \Delta_{n} = x_{n+1}-x_{n} = x_{n}^{3} - (1+a)\ x_{n}= f(x_{n})$ (1)

The behavior of the sequence depends from the 'initial value' $x_{0}$ and from the parameter $a$. We have three possibilities...

a) $a<-1$. In this case any $x_{0}<0$ will produce a sequence that tends to $- \infty$, any $x_{0}>0$ a sequence that tends to $+ \infty$ and $x_{0}=0$ the 'all zeroes sequence'...

b) $-1 < a < 1$. In this case any $x_{0}<- \sqrt{1+a}$ will produce a sequence that tends to $- \infty$, any $x_{0}> + \sqrt{1+a}$ a sequence that tends to $+ \infty$ and any $- \sqrt{1+a} < x_{0}< + \sqrt{1+a}$ a sequence that tends to 0...

c) $a>1$. In this case any $x_{0}<- \sqrt{1+a}$ will produce a sequence that tends to $- \infty$, any $x_{0}> + \sqrt{1+a}$ a sequence that tends to $+ \infty$, any $- \sqrt{1+a} < x_{0}< + \sqrt{1+a}, x_{0}\ne 0$ an 'oscillating sequence' and $x_{0}=0$ the 'all zeroes sequence'...

Kind regards

$\chi$ $\sigma$

3. Thank you very much for your help! So there is no case that the sequence converges to a number and not only diverges? And do you know how is it possible to do this in a Matlab script using iterations? I firstly thought something like

for i=1:200
x(i+1)=x(i)^3-a*x(i);
if abs(x(i+1)-x(i))<0.0000001 (Using Cauchy's convergence test)
fprintf('Sequence converge to some number');
break;
else if (x(i+1)==inf) | (x(i+1)==-inf)
fprintf('The sequence diverges);
break;
end;
end;
end;

I have no other idea...Is it possible to help me a bit? Thanks again!! Appreciate it!