Monday 16 March 2015

Is there a formula for finding the nth number in a sequence with a changing pattern



If a sequence has a pattern where +2 is the pattern at the start, but 1 is added each time, like the sequence below, is there a formula to find the 125th number in this sequence? It would also need to work with patterns similar to this. For example if the pattern started as +4, and 5 was added each time.





2, 4, 7, 11, 16, 22 ...



Answer



Let $a_1 = 2$. From the way you defined the sequence you can see that $a_n - a_{n-1} = n$. We can use this to find
\begin{align}
a_n &= a_{n-1} + n\\
&= a_{n-2} + (n-1) + n\\
&= a_{n-3} + (n-2) + (n-1) + n\\
&\vdots \\

&= a_1 + 2 + \cdots + (n - 2) + (n-1) + n
\end{align}
which is just the sum of the natural numbers except 1($1 + 2 + \cdots + n = \frac{n(n+1)}{2}$). So
\begin{equation}
a_n = a_1 + \frac{n(n+1)}{2} - 1 = 2 - 1 + \frac{n(n+1)}{2} = \frac{n^2 + n + 2}{2}
\end{equation}
where $a_1$ is the starting number (in this case 2). This sequence is a quadratic sequence as it exhibits second differences(the difference of the differences is constant).


No comments:

Post a Comment

real analysis - How to find $lim_{hrightarrow 0}frac{sin(ha)}{h}$

How to find $\lim_{h\rightarrow 0}\frac{\sin(ha)}{h}$ without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...