# Formula for the sequence 0,3,8,15,24 ...

Out of my own interest I've been practicing finding formula for for sequences and I've been having trouble finding one for the nth term for this sequence.

0,3,8,15,24 ...

Clearly you add 5,7,9,11 ... to the previous number but if anyone had some insight about how to express this in a formula that would be much appreciated.

• oeis.org/A005563 Jan 29, 2019 at 3:46
• What you did to the sequence is called taking the forward difference. If you repeat it, you get $2,2,2,2,...$. If the $k$-th forward difference is a constant sequence, the original sequence is a degree-$k$ polynomial sequence. This post explains why, as well as how to efficiently compute the formula from the forward differences. Jan 29, 2019 at 9:38

Add $$1$$ to each term. Do you recognize it now?

• 01-31-81-151-241, is it a phone number?
– JJJ
Jan 29, 2019 at 8:05
• @JJJ: After careful study (of Wiki pages) - no. While many countries have 10-digit phone numbers, none of them format those numbers as 2+2+3+3. Then, we could interpret 31 as a country code (Netherlands), at which point we note that (a) Dutch phone numbers are nine digits long, not eight, and (b) in the geographic system they use, 81 is an unused code. (Yes, I know this was a joke) Jan 29, 2019 at 8:32
• Actually, 01 is the planet code, earth (obviously). 31 is the Dutch country code and (0)81 is actually reserved for free information services, though (081) is not currently given out. See Dutch Law (use CTRL+F, search for '081'). I put the zero in brackets because it's not needed when using the country code.
– JJJ
Jan 29, 2019 at 8:47
• Sorry for a tangent but I wonder if anyone ever asks a question, what is the general formula for 01-31-81-151-241, and get an answer "It's obviously $(n^2-1)''1$..." Jan 29, 2019 at 14:46
• Now become 1,4,9,16,25 . Oct 15, 2019 at 23:17

Clearly, $$a_n-a_{n-1}=2n+1,n\ge1$$

Let $$a_m=b_m+p+qm+rm^2,a_0=0\implies b_0=-p$$

$$2n+1=b_n-b_{n-1}+q+r(2n-1)$$

Set $$2r=2,q-r=1$$ so that $$b_n=b_{n-1}=\cdots=b_0=?$$

• The systematic way. Would you care to add some explanation for why you did what you did? Also, please don't use the same letter for different things; having both $b_m$ the sequence and $b$ the constant is confusing. Jan 29, 2019 at 4:02
• @jmerry, Thanks. See math.stackexchange.com/questions/3080437/… Jan 29, 2019 at 5:03
• That is not a helpful link. You clearly have a method. Your posts do not clearly indicate what that method is, how to apply it, or why it works. That is what I'm looking for. Jan 29, 2019 at 5:14
• @jmerry, If $a_n-a_{n-1}$ is $O(n^k),a_n$ is of the form $O(n^{k+1})$ right? for $k\ge0$ Jan 29, 2019 at 5:26

Ok, so your Growth Rate is f(x) = 2n + 1 As this is Growth, you have to find the Mother Function F(x) = n squared + n ( + c =n in this case), thats it. So its: n squared + 2n !

A recursive general formula seems to be

$$n_0 = 0$$ $$n_k = n_{k-1} + 2k+1$$

The solution for $$a(n)$$ is this $$a(n) = n(n+2) = (n+1)^2 - 1.$$

Well obviously $$a_n=n^2-1, n\in \mathbb{N}.$$

If you look at "really old" numerical analysis books (before about, maybe, 1970), they almost always had a section on (at least) forward differences. You would write down your sequence in a column (maybe with the indices in the column to the left, so you don't get lost), and then in the spaces between the a(i) and to their right, you would write a(i) - a(i-1) = delta(a(i-1)). This is the forward difference. It's a finite difference, the finite analog of the numerator when taking the derivative. If you take the forward difference of the forward difference, that's the second difference. There is one difference from taking derivatives: we could also look at a(i-1) - a(i-2) = del(a(i-1)) = the backwards difference. (I may have my notations backwards. I haven't actually done this stuff since maybe 1985. I mean, with the notation. There's also a central difference, with a minuscule [as opposed to capital] delta, and even off-center differences. People went hog-wild with this stuff before computers, and then it just disappeared in an instant.)

Anyway, you keep taking differences until you get a pattern you recognize. (At this stage, that's probably a constant.) Then you go backward.

So let's say the second difference is 1. Then the first difference (divided by the interval) is n and, just like integrating, we have to add a constant. So if we're working with a sequence (this works just as well for a function), the formula for the first difference is n + C. (We can probably read C off of our table of first differences.) Now we need to know what has a first difference of n? Well, what do you get if you add the first n integers? n(n+1)/2 of course, so that's always the anti-difference of n, and the terms will be n(n+1)/2 + Cn + D.

• Do you have book recommendation? Jan 29, 2019 at 21:55
• @Technophobe01 Not really. I learned this stuff from Stephen G. Kellison, Fundamentals of Numerical Analysis. 1 copy on Amazon, but I looked at it, so the algorithm says the price should skyrocket. Sorry. It'll go back down in about 3 days. Feb 1, 2019 at 19:58
• @Technophobe01 Finding something online is turning out to be harder than I thought. If you google "finite differences" or "forward differences" you'll find out what people are doing now (with tiny changes in point of view from what John Napier and Henry Briggs, e.g.). The main difference between "old" math and "new" math is that lots of old engineering and management, etc. papers told you how to set up your banks of computers--rows of underpaid people (usually women) performing calculations. Feb 1, 2019 at 20:18

There are some rules of thumb for sorting out sequences like this.

Some sequences are Arithmetic Progressions: $$a_0, a_0+k, a_0+2k,...$$

Some sequences are Geometric Progressions: $$a_0, a_0+k, a_0+k^2, a_0+k^3, ...$$

Some are more general Iterative Processes: $$a_{n+1}=a_n+a_{n-1}, a_0=0, a_1=1,$$ e.g. $$0,1,2,3,5,8,...$$

Each of these exhibits different behaviors in their forward differences, the sequence of the difference in their consecutive terms. In arithmetic sequence, this is a constant. In a geometric sequence its a difference of consecutive powers of the common ratio.

Sob often you want to start out calculative difference between consecutive terms. You might want to do this for multiple layers, i.e. calculate the consecutive differences in the sequence of differences.

You might also want to break squences into two sequences before you start taking differences. Sort out the even numbered terms from the odd numbered terms, then perform your difference analysis matching them against the patterns mentioned above.

There are more advanced techniques like Generating Functions and associated Auxiliary Equations but those above are good starting points.

Here's a fun squence to mess around with.

The sum of the first N integers is $$\frac{N(N+1)}{2}$$

The sum of the squares of the first N integers, $$1^2+2^2+...+N^2 = \frac{N(N+1)(2N+1)}{6}$$

The sum of cubes is $$\frac{N^2(N+1)^2}{4}$$

You have a sequence of sequences. What is the formula for adding the fifth powers of the first N inters?

You need to know Arithmetic sequence and Arithmetic series.

let $$n_1 = 0$$ (it means let's counting from 0) $$a_n = a_1+\sum_{k=0}^n b_k$$

$$b_k = a_1 + d(n)$$ ($$b_k$$ is an arithmetic sequence of differences)

$$= 3+2(n)$$

$$= 2n +3$$

$$a_n = 0 + \sum_{k=0}^n 2n + \sum_{k=0}^n 3$$

$$= 2\sum_{k=0}^n n + \sum_{k=0}^n 3$$

$$= 2(n(n+1)/2)+n$$

$$= n^2+n+n$$

$$= n^2+2n$$

$$a_1=(0)^2+2(0)=0$$

$$a_2=(1)^2+2(1)=3$$

$$a_3=(2)^2+2(2)=8$$

$$a_4=(3)^2+2(3)=15$$

$$a_5=(4)^2+2(4)=24$$

https://en.wikipedia.org/wiki/Recurrence_relation#Relationship_to_difference_equations_narrowly_defined

$$x_{n+1}=x_n+(2n+1) \text{ , with } x_1=0$$ Now check this $$x_2=0+(2.1+1)=3, x_3=3+(2.2+1)=8,x_4=8+(2.3+1)=15\text{ and so on.}$$