Message Boards Message Boards

0
|
5345 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

Recognizing the Series from a list of Integers

Posted 11 years ago
Is there a possibility in Notebook to give in a part of a series and solve this for the n-th number.
E.g. {1, 2, 5, 12, 29, 70, 169, 408} these are the first 8 Pell-numbers. How do I calculate the 9th number?
I know that the formula is ((1 + Sqrt[2])^n - (1 - Sqrt[2])^n)/2^(3/2) but that was after a long look that I recognised the Pell-numbers.

Here are the first 9 numbers of another example {1, 2, 5, 12, 29, 70, 169, 408, 969}. Looks like the Pell-numbers series but isn't.
How do I calculate the 10th number? Can Mathematica provide me with the formula?
[1/630 n (2274 - 3444 n + 2569 n^2 - 945 n^3 + 196 n^4 - 21 n^5 + n^6)]
POSTED BY: Pieter Woldinga
Posted 11 years ago
Hi Pieter,

I guess what you're looking for is FindSequenceFunction.

FindSequenceFunction attempts to find a simple function that yields the sequence a_n.

Mathematica does recognise your first sequence as Fibonachi[n,2]
FindSequenceFunction[{1, 2, 5, 12, 29, 70, 169, 408}, n]

=> Fibonacci[n, 2]
Which is, according to oeis.org (online encyclopedia of integer sequences) correct, since Pell-numbers are defined as:
a(0) = 0, a(1) = 1; for n > 1, a(n) = 2*a(n-1) + a(n-2). 
Table[Fibonacci[n, 2], {n, 9}]

=> {1, 2, 5, 12, 29, 70, 169, 408, 985}

Your second sequence is recognised by Mathematica as well:
func = FindSequenceFunction[{1, 2, 5, 12, 29, 70, 169, 408, 969}, n]

=> 1/630 (2274 n - 3444 n^2 + 2569 n^3 - 945 n^4 + 196 n^5 - 21 n^6 + n^7)
If we replace now n with a range [1,10]:
func /. n -> {Range[10]}

=> {1, 2, 5, 12, 29, 70, 169, 408, 969, 2218}

If, by any matter, Mathematica does not find a generating function for an integer sequence you might
consult http://oeis.org. This is normally my first stop when I search for a specific integer sequence.

Hope this helps.
POSTED BY: Stefan Schwarz
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract