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.

A356754 Triangle read by rows: T(n,k) = ((n-1)*(n+2))/2 + 2*k.

Original entry on oeis.org

2, 4, 6, 7, 9, 11, 11, 13, 15, 17, 16, 18, 20, 22, 24, 22, 24, 26, 28, 30, 32, 29, 31, 33, 35, 37, 39, 41, 37, 39, 41, 43, 45, 47, 49, 51, 46, 48, 50, 52, 54, 56, 58, 60, 62, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87
Offset: 1

Views

Author

Torlach Rush, Aug 25 2022

Keywords

Comments

The first column of the triangle is the Lazy Caterer's sequence A000124.
Each subsequent column starts with A000124(n) + (2 * (n-1)).
The first downward diagonal is A046691(n).
Columns and downward diagonals of the triangle identify many sequences (possibly shifted) in the database. Examples can be found in crossrefs below.
The sum of the n-th upward diagonal of the triangle is A356288(n).

Examples

			Triangle T(n,k) begins:
  n\k   1   2   3   4   5   6   7   8   9  10  11  ...
   1:   2
   2:   4   6
   3:   7   9  11
   4:  11  13  15  17
   5:  16  18  20  22  24
   6:  22  24  26  28  30  32
   7:  29  31  33  35  37  39  41
   8:  37  39  41  43  45  47  49  51
   9:  46  48  50  52  54  56  58  60  62
  10:  56  58  60  62  64  66  68  70  72  74
  11:  67  69  71  73  75  77  79  81  83  85  87
  ...
		

Crossrefs

Programs

  • Mathematica
    Table[((n-1)(n+2))/2+2k,{n,20},{k,n}]//Flatten (* Harvey P. Dale, May 26 2023 *)
  • Python
    def T(n, k): return ((n-1) * (n+2))//2 + 2*k
    for n in range(1, 12):
        for k in range(1,(n+1)): print(T(n,k), end = ', ')
    
  • Python
    # Indexed as a linear sequence.
    def a000124(n): return n*(n+1)//2 + 1
    def a(n):
        l = m = 0
        for k in range(1,n):
            lc = a000124(k - 1)
            if n >= lc:
                l = lc
                m = k
            else: break
        return n + m + (n - l)

Formula

T(n,k) = ((n-1) * (n+2))/2 + 2*k.
T(n,k+1) = T(n,k) + 2, k < n.