Just playing around doodling today and I happened across two related sequences of numbers and I'm reaching out to understand what exactly is going on.
Sequence 1
The $n$th term of Sequence 1, $a_n$, is created by (illustration follows):
- Writing $1,\ldots,n$, then $n-1,\ldots,1$ as the angled sides of an isosceles triangle.
- Cells to the left of $n$ are equal to the sum of the two numbers below and to the left; cells to the right of $n$ are equal to the sum of the two numbers below and to the right.
- Cells above $n$ are equal to the sum of the three numbers to the right, left, and below.
- $a_n$ is the entry in the final cell--directly above $n$ and in line with both 1s.
For example, when $n=3$ we can fill in the triangle recursively like so:
1 1 1 3 3 1 1 3 13 7 1
2 2 -> 2 7 2 -> 2 7 2 -> a_3 = 13
3 3 3
The first 7 terms of $a_n$ are 1, 4, 13, 36, 91, 218, and 505. This came up in OEIS as A221882:
The number of order-preserving or order-reversing full contraction mappings of an $n$-chain
With general form: $a_n=(n+1)2^{n-1}-n$.
For Sequence 1, I've got two questions:
- How could one prove the general form from the construction of $a_n$ that I've given?
- What is the relationship of this triangular sequence to the sequence described? (I have no idea what that description means) -or- is there any practical appearance of this sequence?
Sequence 2
Sequence 2, $b_n$, is almost identical to Sequence 1, except that on the right-hand side we continue counting up instead of counting down, that is, we fill in the bottom edges of the triangle with $1,\ldots,n,\ldots,2n-1$, then proceed to calculate $b_n$ as the final filled cell:
1 5 1 3 9 5 1 3 21 9 5
2 4 -> 2 9 4 -> 2 9 4 -> b_3 = 21
3 3 3
The first 7 terms of $b_n$ are 1, 6, 21, 60, 155, 378, and 889. This came up in OEIS as A066524; there's no simple description of this one. One of the candidate matches involves triangles, but I think constructed in a different way:
Form a triangle in which interior members $T(i,j) = T(i-1,j-1) + T(i-1,j)$. The exterior members are given by $1,2,3,\ldots,2n-1$: $T(1,1)=n, T(2,1)=n-1, T(3,1)=n-2, \ldots, T(n,1)=1$ and $T(2,2)=n+1, T(3,3)=n+2, ..., T(n,n)=2n-1$. The sum of all members will reproduce this sequence. For example, with $n=4$ the exterior members are 1 to 7: row(1)=4; row(2)=3,5; row(3)=2,8,6; row(4)=1,10,14,7. The sum of all these members is 60, the fourth term in the sequence. - J. M. Bergot, Oct 16 2012
The closed form for this is: $$b_n=n(2^n-1)$$ My questions for Sequence 2 are:
- How can one prove the closed form above? Is there a direct relationship to $a_n$ above?
- What is the relationship between this and the other appearances of this sequence mentioned on OEIS? Any practical use?
Answer to the First Question for Sequence Two
Let $b_n=n2^n$. Then, we have
$$\begin{align} b_n-2b_{n-1}&=n2^n-2(n-1)2^{n-1}\\\\ &=2^n \end{align}$$
Note that we can add to $b_n$ any multiple of $2^n$ and satisfy the difference equation $b_n-2b_{n-1}=2^n$. Therefore, the general solution to the difference equation $b_n-2b_{n-1}=2^n$ is given by
$$b_n=n\,2^n+b_0\,2^n$$