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.

A368045 Triangle read by rows. T(n, k) = (k*(k + 1)*(2*k + 1) + n*(n + 1)*(2*n + 1)) / 6.

Original entry on oeis.org

0, 1, 2, 5, 6, 10, 14, 15, 19, 28, 30, 31, 35, 44, 60, 55, 56, 60, 69, 85, 110, 91, 92, 96, 105, 121, 146, 182, 140, 141, 145, 154, 170, 195, 231, 280, 204, 205, 209, 218, 234, 259, 295, 344, 408, 285, 286, 290, 299, 315, 340, 376, 425, 489, 570
Offset: 0

Views

Author

Peter Luschny, Dec 09 2023

Keywords

Comments

Consider a sequence-to-triangle transformation a -> T, where a is a 0-based sequence and T a regular (0, 0)-based triangular array. The transformation is recursively defined, starting with T(0, 0) = 0, and T(n, n) = a(n) + T(n, n - 1) for n > 0. For k <> n let T(n, k) = a(n) + T(n-1, k).
If a(n) = 1, then T = A051162; if a(n) = n, then T = A367964 (generalizing the triangular numbers); if a(n) = n^2, then T is this triangle.
In the multiplicative form of the transformation, T(0, 0) is set to 1, and the operation '+' is replaced by '*'. For instance, a(n) = 2 is then mapped to T = A368043 and a(n) = n to A143216.

Examples

			Triangle T(n, k) starts:
  [0] [  0]
  [1] [  1,   2]
  [2] [  5,   6,  10]
  [3] [ 14,  15,  19,  28]
  [4] [ 30,  31,  35,  44,  60]
  [5] [ 55,  56,  60,  69,  85, 110]
  [6] [ 91,  92,  96, 105, 121, 146, 182]
  [7] [140, 141, 145, 154, 170, 195, 231, 280]
  [8] [204, 205, 209, 218, 234, 259, 295, 344, 408]
  [9] [285, 286, 290, 299, 315, 340, 376, 425, 489, 570]
		

Crossrefs

Cf. A000330 (T(n,0)), A056520 (T(n,1)), A005900 (T(n-1,n)), A006331 (T(n,n)), A094952 (T(2*n,n)), A368046 (row sums), A368047 (alternating row sums).
Cf. A051162 (transform of n^0), A367964 (transform of n^1), this sequence (transform of n^2).

Programs

  • Mathematica
    Module[{n=1},NestList[Append[#+n^2,Last[#]+2(n++^2)]&,{0},10]] (* or *)
    Table[(k(k+1)(2k+1)+n(n+1)(2n+1))/6,{n,0,10},{k,0,n}] (* Paolo Xausa, Dec 10 2023 *)
  • Python
    from functools import cache
    @cache
    def Trow(n: int) -> list[int]:
        if n == 0: return [0]
        row = Trow(n - 1) + [0]
        for k in range(n): row[k] += n * n
        row[n] = row[n - 1] + n * n
        return row
    print([k for n in range(10) for k in Trow(n)])

Formula

T(n, k) = A000330(k) + A000330(n).