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.

Showing 1-2 of 2 results.

A365673 Array A(n, k) read by ascending antidiagonals. Polygonal number weighted generalized Catalan sequences.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 4, 1, 1, 1, 4, 15, 8, 1, 1, 1, 5, 34, 105, 16, 1, 1, 1, 6, 61, 496, 945, 32, 1, 1, 1, 7, 96, 1385, 11056, 10395, 64, 1, 1, 1, 8, 139, 2976, 50521, 349504, 135135, 128, 1, 1, 1, 9, 190, 5473, 151416, 2702765, 14873104, 2027025, 256, 1
Offset: 0

Views

Author

Peter Luschny, Sep 30 2023

Keywords

Comments

Using polygonal numbers as weights, a recursion for triangles is defined, whose main diagonals represents a family of sequences, which include, among others, the powers of 2, the double factorial of odd numbers, the reduced tangent numbers, and the Euler numbers.
Apart from the edge cases k = 0 and k = n the recursion is T(n, k) = w(n, k) * T(n, k - 1) + T(n - 1, k). T(n, 0) = 1 and T(n, n) = T(n, n-1) if n > 0.
The weights w(n, k) identical to 1 yield the recursion of the Catalan triangle A009766 (with main diagonal the Catalan numbers). Here the polygonal numbers are used as weights in the form w(n, k) = p(s, n - k + 1), where the parameter s is the number of sides of the polygon and p(s, n) = ((s-2) * n^2 - (s-4) * n) / 2, see A317302.

Examples

			Array A(n, k) starts:                            (polygon|diagonal|triangle)
[0] 1, 1, 1,   1,     1,       1,         1, ...  A258837  A000012
[1] 1, 1, 2,   4,     8,      16,        32, ...  A080956  A011782
[2] 1, 1, 3,  15,   105,     945,     10395, ...  A001477  A001147  A001498
[3] 1, 1, 4,  34,   496,   11056,    349504, ...  A000217  A002105  A365674
[4] 1, 1, 5,  61,  1385,   50521,   2702765, ...  A000290  A000364  A060058
[5] 1, 1, 6,  96,  2976,  151416,  11449296, ...  A000326  A126151  A366138
[6] 1, 1, 7, 139,  5473,  357721,  34988647, ...  A000384  A126156  A365672
[7] 1, 1, 8, 190,  9080,  725320,  87067520, ...  A000566  A366150  A366149
[8] 1, 1, 9, 249, 14001, 1322001, 188106489, ...  A000567
           A054556                         A366137
		

Crossrefs

Cf. A009766, A366137 (central diagonal), A317302 (table of polygonal numbers).

Programs

  • Maple
    poly := (s, n) -> ((s - 2) * n^2 - (s - 4) * n) / 2:
    T := proc(s, n, k) option remember; if k = 0 then 1 else if k = n then T(s, n, k-1) else poly(s, n - k + 1) * T(s, n, k - 1) + T(s, n - 1, k) fi fi end:
    for n from 0 to 8 do A := (n, k) -> T(n, k, k): seq(A(n, k), k = 0..9) od;
    # Alternative, using continued fractions:
    A := proc(p, L) local CF, poly, k, m, P, ser;
       poly := (s, n) -> ((s - 2)*n^2 - (s - 4)*n)/2;
       CF := 1 + x;
       for k from 1 to L do
           m := L - k + 1;
           P := poly(p, m);
           CF := 1/(1 - P*x*CF)
       od;
       ser := series(CF, x, L);
       seq(coeff(ser, x, m), m = 0..L-1)
    end:
    for p from 0 to 8 do lprint(A(p, 8)) od;
  • Mathematica
    poly[s_, n_] := ((s - 2) * n^2 - (s - 4) * n) / 2;
    T[s_, n_, k_] := T[s, n, k] = If[k == 0, 1, If[k == n, T[s, n, k - 1], poly[s, n - k + 1] * T[s, n, k - 1] + T[s, n - 1, k]]];
    A[n_, k_] := T[n, k, k];
    Table[A[n - k, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Nov 27 2023, from first Maple program *)
  • PARI
    A(p, n) = {
           my(CF = 1 + x,
               poly(s, n) = ((s - 2)*n^2 - (s - 4)*n)/2,
               m, P
           );
           for(k = 1, n,
               m = n - k + 1;
               P = poly(p, m);
               CF = 1/(1 - P*x*CF)
            );
            Vec(CF + O(x^(n)))
    }
    for(p = 0, 8, print(A(p, 8)))
    \\  Michel Marcus and Peter Luschny, Oct 02 2023
  • Python
    from functools import cache
    @cache
    def T(s, n, k):
        if k == 0: return 1
        if k == n: return T(s, n, k - 1)
        p = (n - k + 1) * ((s - 2) * (n - k + 1) - (s - 4)) // 2
        return p * T(s, n, k - 1) + T(s, n - 1, k)
    def A(n, k): return T(n, k, k)
    for n in range(9): print([A(n, k) for k in range(9)])
    

A317302 Square array T(n,k) = (n - 2)*(k - 1)*k/2 + k, with n >= 0, k >= 0, read by antidiagonals upwards.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 0, 1, 1, -3, 0, 1, 2, 0, -8, 0, 1, 3, 3, -2, -15, 0, 1, 4, 6, 4, -5, -24, 0, 1, 5, 9, 10, 5, -9, -35, 0, 1, 6, 12, 16, 15, 6, -14, -48, 0, 1, 7, 15, 22, 25, 21, 7, -20, -63, 0, 1, 8, 18, 28, 35, 36, 28, 8, -27, -80, 0, 1, 9, 21, 34, 45, 51, 49, 36, 9, -35, -99, 0, 1, 10, 24, 40, 55, 66
Offset: 0

Views

Author

Omar E. Pol, Aug 09 2018

Keywords

Comments

Note that the formula gives several kinds of numbers, for example:
Row 0 gives 0 together with A258837.
Row 1 gives 0 together with A080956.
Row 2 gives A001477, the nonnegative numbers.
For n >= 3, row n gives the n-gonal numbers (see Crossrefs section).

Examples

			Array begins:
------------------------------------------------------------------------
n\k  Numbers       Seq. No.   0   1   2   3   4    5    6    7    8
------------------------------------------------------------------------
0    ............ (A258837):  0,  1,  0, -3, -8, -15, -24, -35, -48, ...
1    ............ (A080956):  0,  1,  1,  0, -2,  -5,  -9, -14, -20, ...
2    Nonnegatives  A001477:   0,  1,  2,  3,  4,   5,   6,   7,   8, ...
3    Triangulars   A000217:   0,  1,  3,  6, 10,  15,  21,  28,  36, ...
4    Squares       A000290:   0,  1,  4,  9, 16,  25,  36,  49,  64, ...
5    Pentagonals   A000326:   0,  1,  5, 12, 22,  35,  51,  70,  92, ...
6    Hexagonals    A000384:   0,  1,  6, 15, 28,  45,  66,  91, 120, ...
7    Heptagonals   A000566:   0,  1,  7, 18, 34,  55,  81, 112, 148, ...
8    Octagonals    A000567:   0,  1,  8, 21, 40,  65,  96, 133, 176, ...
9    9-gonals      A001106:   0,  1,  9, 24, 46,  75, 111, 154, 204, ...
10   10-gonals     A001107:   0,  1, 10, 27, 52,  85, 126, 175, 232, ...
11   11-gonals     A051682:   0,  1, 11, 30, 58,  95, 141, 196, 260, ...
12   12-gonals     A051624:   0,  1, 12, 33, 64, 105, 156, 217, 288, ...
13   13-gonals     A051865:   0,  1, 13, 36, 70, 115, 171, 238, 316, ...
14   14-gonals     A051866:   0,  1, 14, 39, 76, 125, 186, 259, 344, ...
15   15-gonals     A051867:   0,  1, 15, 42, 82, 135, 201, 280, 372, ...
...
		

Crossrefs

Column 0 gives A000004.
Column 1 gives A000012.
Column 2 gives A001477, which coincides with the row numbers.
Main diagonal gives A060354.
Row 0 gives 0 together with A258837.
Row 1 gives 0 together with A080956.
Row 2 gives A001477, the same as column 2.
For n >= 3, row n gives the n-gonal numbers: A000217 (n=3), A000290 (n=4), A000326 (n=5), A000384 (n=6), A000566 (n=7), A000567 (n=8), A001106 (n=9), A001107 (n=10), A051682 (n=11), A051624 (n=12), A051865 (n=13), A051866 (n=14), A051867 (n=15), A051868 (n=16), A051869 (n=17), A051870 (n=18), A051871 (n=19), A051872 (n=20), A051873 (n=21), A051874 (n=22), A051875 (n=23), A051876 (n=24), A255184 (n=25), A255185 (n=26), A255186 (n=27), A161935 (n=28), A255187 (n=29), A254474 (n=30).
Cf. A303301 (similar table but with generalized polygonal numbers).

Formula

T(n,k) = A139600(n-2,k) if n >= 2.
T(n,k) = A139601(n-3,k) if n >= 3.
Showing 1-2 of 2 results.