cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A249111 Triangle of partial sums of rows in triangle A249095.

Original entry on oeis.org

1, 1, 2, 3, 1, 2, 4, 5, 6, 1, 2, 5, 7, 10, 11, 12, 1, 2, 6, 9, 15, 18, 22, 23, 24, 1, 2, 7, 11, 21, 27, 37, 41, 46, 47, 48, 1, 2, 8, 13, 28, 38, 58, 68, 83, 88, 94, 95, 96, 1, 2, 9, 15, 36, 51, 86, 106, 141, 156, 177, 183, 190, 191, 192, 1, 2, 10, 17, 45, 66
Offset: 0

Views

Author

Reinhard Zumkeller, Nov 14 2014

Keywords

Comments

Length of row n = 2*n+1.
In the layout as given in the example, T(n,k) is the sum of the two elements to the left and to the right of the element just above, with the row continued to the left by 0's and to the right by the last element, cf. formula. - M. F. Hasler, Nov 17 2014

Examples

			The triangle begins:
.  0:                            1
.  1:                        1   2   3
.  2:                    1   2   4   5   6
.  3:                1   2   5   7  10  11  12
.  4:             1  2   6   9  15  18  22  23  24
.  5:          1  2  7  11  21  27  37  41  46  47  48
.  6:       1  2  8 13  28  38  58  68  83  88  94  95  96
.  7:    1  2  9 15 36  51  86 106 141 156 177 183 190 191 192
.  8:  1 2 10 17 45 66 122 157 227 262 318 339 367 374 382 383 384 .
It can be seen that the elements (except for row 1) are sum of the neighbors to the upper left and upper right, with the table continued to the left with 0's and to the right with the last = largest element of each row. E.g., 1=0+1, 2=0+2, 4=1+3, 5=2+3 (=1+4 in the next row), 6=3+3 (in row 2), 7=2+5 etc. - _M. F. Hasler_, Nov 17 2014
		

Crossrefs

Cf. A005408 (row lengths), A128543 (row sums), A248574 (central terms), A008949.

Programs

  • Haskell
    a249111 n k = a249111_tabf !! n !! k
    a249111_row n = a249111_tabf !! n
    a249111_tabf = map (scanl1 (+)) a249095_tabf
    
  • PARI
    T(n,k)=if(k<2,k+1,if(k>=2*n-2,3<<(n-1),T(n-1,k-2)+T(n-1,k))) \\ M. F. Hasler, Nov 17 2014

Formula

T(n,0) = A249095(n,0) = 1; T(n,k) = T(n,k-1) + A249095(n,k), k <= n.
T(n+1,k+1) = T(n,k-1) + T(n,k+1), with T(n,k-1)=0 for k<1 and T(n,k+1)=T(n,k) for k>=2n (last element of the row). In particular, T(n,k)=k+1 if k<2n and T(n,k)=3*2^(n-1) if k>=2n. - M. F. Hasler, Nov 17 2014