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.

A377802 Triangle read by rows: T(n, k) = (2 * (n+1)^2 + 7 - (-1)^n) / 8 - k.

Original entry on oeis.org

1, 2, 1, 4, 3, 2, 6, 5, 4, 3, 9, 8, 7, 6, 5, 12, 11, 10, 9, 8, 7, 16, 15, 14, 13, 12, 11, 10, 20, 19, 18, 17, 16, 15, 14, 13, 25, 24, 23, 22, 21, 20, 19, 18, 17, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31
Offset: 1

Views

Author

Werner Schulte, Nov 07 2024

Keywords

Comments

The natural numbers, based on quarter-squares (A002620 and A033638); every natural number occurs exactly twice.

Examples

			Triangle T(n, k) for 1 <= k <= n starts:
n\ k :   1   2   3   4   5   6   7   8   9  10  11  12  13
==========================================================
   1 :   1
   2 :   2   1
   3 :   4   3   2
   4 :   6   5   4   3
   5 :   9   8   7   6   5
   6 :  12  11  10   9   8   7
   7 :  16  15  14  13  12  11  10
   8 :  20  19  18  17  16  15  14  13
   9 :  25  24  23  22  21  20  19  18  17
  10 :  30  29  28  27  26  25  24  23  22  21
  11 :  36  35  34  33  32  31  30  29  28  27  26
  12 :  42  41  40  39  38  37  36  35  34  33  32  31
  13 :  49  48  47  46  45  44  43  42  41  40  39  38  37
  etc.
		

Crossrefs

A002620 (column 1), A024206 (column 2), A014616 (column 3), A004116 (column 4), A033638 (main diagonal), A290743 (1st subdiagonal).

Programs

  • PARI
    T(n,k)=(2*(n+1)^2+7-(-1)^n)/8-k

Formula

T(n, k) = A002620(n+1) + 1 - k.
T(2*n-1, n) = n^2 - n + 1 = A002061(n); T(2*n-2, n) = (n-1)^2 = A000290(n-1) for n > 1; T(2*n-3, n) = (n-1) * (n-2) = A002378(n-2) for n > 2; T(2*n-4, n) = (n-1) * (n-3) = A005563(n-3) for n > 3.
Row sums are (2 * n^3 + 5 * n - n * (-1)^n) / 8 = (A006003(n) + A026741(n)) / 2.
G.f.: x*y*(1 - x*y + x^2*y + x^4*y^2 - x^5*y^3 + x^6*y^3 - x^3*y*(1 + 2*y - y^2))/((1 - x)^3*(1 + x)*(1 - x*y)^3*(1 + x*y)). - Stefano Spezia, Nov 08 2024