The On-Line Encyclopedia of Integer Sequences
I do hate these problems because I think they serve no purpose.
This has been bugging me for a while:
If I have a number sequence for example, 1, 2, 4, 7, 11
So its like adding 1 then 2 then 3 then 4 and so on..
How would I write it in terms of n?
My teacher had a method which I dodnt write down in year 9 (am now in year 11) that you wrote a number sequence then drew an arrow down to the number sequence in the question and saw the relationship im wondering if anyone is familiar with that?
If u closely see the sequence......u can come up with this relation
f(n) = f(n-1) + n-1 where f(1)=1 ---------(1)
Follow thes steps....
f(n) = f(n-1) + n-1 //Now substitute for f(n-1) using ----(1)
= [f(n-2) + n-2] + n-1
= f(n-2) + 2n -(1+2)
= [f(n-3) + n-3)] + 2n -(1+2) //Now substitute for f(n-2) using ---(1)
= f(n-3) +3n - (1 + 2 + 3)
= f(n-k) + kn -(1+2+3 +.......k)
Now we know the value of f(1)=1.....soo.....to make f(n-k) =f(1).....n-k=1 => k=n-1
then the abv becmes....
=f(1) + (n-1)n -(n-1)n/2
=1 + n(n-1)/2
Is there an easier way to work out a number sequence which isn't linear?
If we know that the formula is a quadratic, there is a sneaky way,
. . but you may need some background.
We begin with a basic quadratic function: .
This generates the Triangular Numbers: 1, 3, 6, 10, 15, . . .
And it should be obvious why they are called "triangular."Code:o o o o o o o o o o o o o o o o o o o o 1 3 6 10
So we have the formula: .
. . and we will modify it to fit the given sequence: 1, 2, 4, 7, 11, 16, 22, . . .
For the first few values, compare our sequence to the triangular numbers
The values of do not match those of
. . Some adjustments are necessary . . . let's examine them.
We see that we must subtract a number one less than
. . Hence: .
And we have: .
. . Therefore: .