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-8 of 8 results.

A065941 T(n,k) = binomial(n-floor((k+1)/2), floor(k/2)). Triangle read by rows, for 0 <= k <= n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 1, 4, 3, 3, 1, 1, 1, 5, 4, 6, 3, 1, 1, 1, 6, 5, 10, 6, 4, 1, 1, 1, 7, 6, 15, 10, 10, 4, 1, 1, 1, 8, 7, 21, 15, 20, 10, 5, 1, 1, 1, 9, 8, 28, 21, 35, 20, 15, 5, 1, 1, 1, 10, 9, 36, 28, 56, 35, 35, 15, 6, 1, 1, 1, 11, 10, 45, 36, 84, 56, 70, 35, 21, 6, 1
Offset: 0

Views

Author

Len Smiley, Nov 29 2001

Keywords

Comments

Also the q-Stirling2 numbers at q = -1. - Peter Luschny, Mar 09 2020
Row sums give the Fibonacci sequence. So do the alternating row sums.
Triangle of coefficients of polynomials defined by p(-1,x) = p(0,x) = 1, p(n, x) = x*p(n-1, x) + p(n-2, x), for n >= 1. - Benoit Cloitre, May 08 2005 [rewritten with correct offset. - Wolfdieter Lang, Feb 18 2020]
Another version of triangle in A103631. - Philippe Deléham, Jan 01 2009
The T(n,k) coefficients appear in appendix 2 of Parks's remarkable article "A new proof of the Routh-Hurwitz stability criterion using the second method of Liapunov" if we assume that the b(n) coefficients are all equal to 1 and ignore the first column. The complete version of this triangle including the first column is A103631. - Johannes W. Meijer, Aug 11 2011
Signed ++--++..., the roots are chaotic using f(x) --> x^2 - 2 with cycle lengths shown in A003558 by n-th rows. Example: given row 3, x^3 + x^2 - 2x - 1; the roots are (a = 1.24697, ...; b = -0.445041, ...; c = -1.802937, ...). Then (say using seed b with x^2 - 2) we obtain the trajectory -0.445041, ... -> -1.80193, ... -> 1.24697, ...; matching the entry "3" in A003558(3). - Gary W. Adamson, Sep 06 2011
From Gary W. Adamson, Aug 25 2019: (Start)
Roots to the polynomials and terms in A003558 can all be obtained from the numbers below using a doubling series mod N procedure as follows: (more than one row may result). Any row ends when the trajectory produces a term already used. Then try the next higher odd term not used as the leftmost term, then repeat.
For example, for N = 11, we get: (1, 2, 4, 3, 5), showing that when confronted with two choices after the 4: (8 and -3), pick the smaller (abs) term, = 3. Then for the next row pick 7 (not used) and repeat the algorithm; succeeding only if the trajectory produces new terms. But 7 is also (-4) mod 11 and 4 was used. Therefore what I call the "r-t table" (for roots trajectory) has only one row: (1, 2, 4, 3, 5). Conjecture: The numbers of terms in the first row is equal to A003558 corresponding to N, i.e., 5 in this case with period 2.
Now for the roots to the polynomials. Pick N = 7. The polynomial is x^3 - x^2 - 2x + 1 = 0, with roots 1.8019..., -1.2469... and 0.445... corresponding to 2*cos(j*Pi/N), N = 7, and j = (1, 2, and 3). The terms (1, 2, 3) are the r-t terms for N = 7. For 11, the r-t terms are (1, 2, 4, 3, 5). This implies that given any roots of the corresponding polynomial, they are cyclic using f(x) --> x^2 - 2 with cycle lengths shown in A003558. The terms thus generated are 2*cos(j*Pi), with j = (1, 2, 4, 3, 5). Check: Begin with 2*j*Pi/N, with j = 1 (1.9189...). The other trajectory terms are: --> 1.6825..., --> 0.83083..., -1.3097...; 545...; (a 5 period and cyclic since we can begin with any of the constants). The r-t table for odd N begins as follows:
3...............1
5...............1, 2
7...............1, 2, 3
9...............1, 2, 4
...............3 (singleton terms reduce to "1") (9 has two rows)
11...............1, 2, 4, 3, 5
13...............1, 2, 4, 5, 3, 6
15...............1, 2, 4, 7
................3, 6 (dividing through by the gcd gives (1, 2))
................5. (singleton terms reduce to "1")
The result is that 15 has 3 factors (since 3 rows), and the values of those factors are the previous terms "N", corresponding to the r-t terms in each row. Thus, the first row is new, the second (1, 2), corresponds to N = 5, and the "1" in row 3 corresponds to N = 3. The factors are those values apart from 15 and 1. Note that all of the unreduced r-t terms in all rows for N form a complete set of the terms 1 through (N-1)/2 without duplication. (End)
From Gary W. Adamson, Sep 30 2019: (Start)
The 3 factors of the 7th degree polynomial for 15: (x^7 - x^6 - 6x^5 + 5x^4 + 10x^3 - 6x^2 - 4x + 1) can be determined by getting the roots for 2*cos(j*Pi/1), j = (1, 2, 4, 7) and finding the corresponding polynomial, which is x^4 + x^3 - 4x^2 - 4x + 1. This is the minimal polynomial for N = 15 as shown in Table 2, p. 46 of (Lang). The degree of this polynomial is 4, corresponding to the entry in A003558 for 15, = 4. The trajectories (3, 6) and (5) are j values for 2*cos(j*Pi/15) which are roots to x^2 - x - 1 (relating to the pentagon), and (x - 1), relating to the triangle. (End)
From Gary W. Adamson, Aug 21 2019: (Start)
Matrices M of the form: (1's in the main diagonal, -1's in the subdiagonal, and the rest zeros) are chaotic if we replace (f(x) --> x^2 - 2) with f(x) --> M^2 - 2I, where I is the Identity matrix [1, 0, 0; 0, 1, 0; 0, 0, 1]. For example, with the 3 X 3 matrix M: [0, 0, 1; 0, 1, -1; 1, -1, 0]; the f(x) trajectory is:
....M^2 - 2I: [-1, -1, 0; -1, 0, -1; 0, -1, 0], then for the latter,
....M^2 - 2I: [0, 1, 1; 1, 0, 0; 1, 0, -1]. The cycle ends with period 3 since the next matrix is (-1) * the seed matrix. As in the case with f(x) --> x^2 - 2, the eigenvalues of the 3 chaotic matrices are (abs) 1.24697, 0.44504... and 1.80193, ... Also, the characteristic equations of the 3 matrices are the same as or variants of row 4 of the triangle below: (x^3 + x - 2x - 1) with different signs. (End)
Received from Herb Conn, Jan 2004: (Start)
Let x = 2*cos(2A) (A = Angle); then
sin(A)/sin A = 1
sin(3A)/sin A = x + 1
sin(5A)/sin A = x^2 + x - 1
sin(7A)/sin A = x^3 + x - 2x - 1
sin(9A)/sin A = x^4 + x^3 - 3x^2 - 2x + 1
... (signed ++--++...). (End)
Or Pascal's triangle (A007318) with duplicated diagonals. Also triangle of coefficients of polynomials defined by P_0(x) = 1 and for n>=1, P_n(x) = F_n(x) + F_(n+1)(x), where F_n(x) is Fibonacci polynomial (cf. A049310): F_n(x) = Sum_{i=0..floor((n-1)/2)} C(n-i-1,i)*x^(n-2*i-1). - Vladimir Shevelev, Apr 12 2012
The matrix inverse is given by
1;
1, 1;
0, -1, 1;
0, 1, -2, 1;
0, 0, 1, -2, 1;
0, 0, -1, 3, -3, 1;
0, 0, 0, -1, 3, -3, 1;
0, 0, 0, 1, -4, 6, -4, 1;
0, 0, 0, 0, 1, -4, 6, -4, 1;
... apart from signs the same as A124645. - R. J. Mathar, Mar 12 2013

Examples

			Triangle T(n, k) begins:
n\k 0  1  2  3   4   5  6   7  8  9 ...
---------------------------------------
[0] 1,
[1] 1, 1,
[2] 1, 1, 1,
[3] 1, 1, 2, 1,
[4] 1, 1, 3, 2,  1,
[5] 1, 1, 4, 3,  3,  1,
[6] 1, 1, 5, 4,  6,  3,  1,
[7] 1, 1, 6, 5, 10,  6,  4,  1,
[8] 1, 1, 7, 6, 15, 10, 10,  4,  1,
[9] 1, 1, 8, 7, 21, 15, 20, 10,  5, 1,
---------------------------------------
From _Gary W. Adamson_, Oct 23 2019: (Start)
Consider the roots of the polynomials corresponding to odd N such that for N=7 the polynomial is (x^3 + x^2 - 2x - 1) and the roots (a, b, c) are (-1.8019377..., 1.247697..., and -0.445041...). The discriminant of a polynomial derived from the roots is the square of the product of successive differences: ((a-b), (b-c), (c-a))^2 in this case, resulting in 49, matching the method derived from the coefficients of a cubic. For our purposes we use the product of the differences, not the square, resulting in (3.048...) * (1.69202...) * (1.35689...) = 7.0. Conjecture: for all polynomials in the set, the product of the differences of the roots = the corresponding N. For N = 7, we get x^3 - 7x + 7. It appears that for all prime N's, these resulting companion polynomials are monic (left coefficient is 1), and all other coefficients are N or multiples thereof, with the rightmost term = N. The companion polynomials for the first few primes are:
  N =  5:  x^2 - 5;
  N =  7:  x^3 - 7x + 7;
  N = 11:  x^5 - 11x^3 + 11x^2 + 11x - 11;
  N = 13:  x^6 - 13x^4 + 13x^3 + 26x^2 - 39x + 13;
  N = 17:  x^8 - 17x^6 + 17x^5 + 68x^4 - 119x^3 + 17x^2 + 51x - 17;
  N = 19:  x^9 - 19x^7 + 19x^6 + 95x^5 - 171x^4 - 19x^3 + 190x^2 - 114x + 19. (End)
		

Crossrefs

Cf. A065942 (central stalk sequence), A000045 (row sums), A108299.
Reflected version of A046854.
Some triangle sums (see A180662): A000045 (Fi1), A016116 (Kn21), A000295 (Kn23), A094967 (Fi2), A000931 (Ca2), A001519 (Gi3), A000930 (Ze3).

Programs

  • Haskell
    a065941 n k = a065941_tabl !! n !! k
    a065941_row n = a065941_tabl !! n
    a065941_tabl = iterate (\row ->
       zipWith (+) ([0] ++ row) (zipWith (*) (row ++ [0]) a059841_list)) [1]
    -- Reinhard Zumkeller, May 07 2012
    
  • Magma
    [Binomial(n - Floor((k+1)/2), Floor(k/2)): k in [0..n], n in [0..15]]; // G. C. Greubel, Jul 10 2019
    
  • Maple
    A065941 := proc(n,k): binomial(n-floor((k+1)/2),floor(k/2)) end: seq(seq(A065941(n,k), k=0..n), n=0..15); # Johannes W. Meijer, Aug 11 2011
    A065941 := proc(n,k) option remember: local j: if k=0 then 1 elif k=1 then 1: elif k>=2 then add(procname(j,k-2), j=k-2..n-2) fi: end: seq(seq(A065941(n,k), k=0..n), n=0..15);  # Johannes W. Meijer, Aug 11 2011
    # The function qStirling2 is defined in A333143.
    seq(print(seq(qStirling2(n, k, -1), k=0..n)), n=0..9);
    # Peter Luschny, Mar 09 2020
  • Mathematica
    Flatten[Table[Binomial[n-Floor[(k+1)/2],Floor[k/2]],{n,0,15},{k,0,n}]] (* Harvey P. Dale, Dec 11 2011 *)
  • PARI
    T065941(n, k) = binomial(n-(k+1)\2, k\2); \\ Michel Marcus, Apr 28 2014
    
  • Sage
    [[binomial(n - floor((k+1)/2), floor(k/2)) for k in (0..n)] for n in (0..15)] # G. C. Greubel, Jul 10 2019

Formula

T(n, k) = binomial(n-floor((k+1)/2), floor(k/2)).
As a square array read by antidiagonals, this is given by T1(n, k) = binomial(floor(n/2) + k, k). - Paul Barry, Mar 11 2003
Triangle is a reflection of that in A066170 (absolute values). - Gary W. Adamson, Feb 16 2004
Recurrences: T(k, 0) = 1, T(k, n) = T(k-1, n) + T(k-2, n-2), or T(k, n) = T(k-1, n) + T(k-1, n-1) if n even, T(k-1, n-1) if n odd. - Ralf Stephan, May 17 2004
G.f.: sum[n, sum[k, T(k, n)x^ky^n]] = (1+xy)/(1-y-x^2y^2). sum[n>=0, T(k, n)y^n] = y^k/(1-y)^[k/2]. - Ralf Stephan, May 17 2004
T(n, k) = A108299(n, k)*A087960(k) = abs(A108299(n, k)). - Reinhard Zumkeller, Jun 01 2005
From Johannes W. Meijer, Aug 11 2011: (Start)
T(n,k) = A046854(n, n-k) = abs(A066170(n, n-k)).
T(n+k, n-k) = A109223(n,k).
T(n, k) = sum(T(j, k-2), j=k-2..n-2), 2 <= k <= n, n>=2;
T(n, 0) =1, T(n+1, 1) = 1, n >= 0. (End)
For n > 1: T(n, k) = T(n-2, k) + T(n-1, k), 1 < k < n. - Reinhard Zumkeller, Apr 24 2013

A022167 Triangle of Gaussian binomial coefficients [ n,k ] for q = 3.

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 1, 13, 13, 1, 1, 40, 130, 40, 1, 1, 121, 1210, 1210, 121, 1, 1, 364, 11011, 33880, 11011, 364, 1, 1, 1093, 99463, 925771, 925771, 99463, 1093, 1, 1, 3280, 896260, 25095280, 75913222, 25095280, 896260, 3280, 1
Offset: 0

Views

Author

Keywords

Comments

The coefficients of the matrix inverse are apparently given by T^(-1)(n,k) = (-1)^n*A157783(n,k). - R. J. Mathar, Mar 12 2013

Examples

			Triangle begins:
  1;
  1,    1;
  1,    4,      1;
  1,   13,     13,        1;
  1,   40,    130,       40,        1;
  1,  121,   1210,     1210,      121,        1;
  1,  364,  11011,    33880,    11011,      364,      1;
  1, 1093,  99463,   925771,   925771,    99463,   1093,    1;
  1, 3280, 896260, 25095280, 75913222, 25095280, 896260, 3280, 1;
		

References

  • F. J. MacWilliams and N. J. A. Sloane, The Theory of Error-Correcting Codes, Elsevier-North Holland, 1978, p. 698.
  • M. Sved, Gaussians and binomials, Ars. Combinatoria, 17A (1984), 325-351.

Crossrefs

Columns k=0..3 give A000012, A003462, A006100, A006101.
Cf. A006117 (row sums).

Programs

Formula

T(n,k) = T(n-1,k-1) + q^k * T(n-1,k). - Peter A. Lawrence, Jul 13 2017
T(n,k) = Sum_{j=0..k} C(n,j)*qStirling2(n-j,n-k,3)*(2)^(k-j),j,0,k), n >= k, where qStirling2(n,k,3) is triangle A333143. - Vladimir Kruchinin, Mar 07 2020
G.f. of column k: x^k * exp( Sum_{j>=1} f((k+1)*j)/f(j) * x^j/j ), where f(j) = 3^j - 1. - Seiichi Manyama, May 09 2025

A374439 Triangle read by rows: the coefficients of the Lucas-Fibonacci polynomials. T(n, k) = T(n - 1, k) + T(n - 2, k - 2) with initial values T(n, k) = k + 1 for k < 2.

Original entry on oeis.org

1, 1, 2, 1, 2, 1, 1, 2, 2, 2, 1, 2, 3, 4, 1, 1, 2, 4, 6, 3, 2, 1, 2, 5, 8, 6, 6, 1, 1, 2, 6, 10, 10, 12, 4, 2, 1, 2, 7, 12, 15, 20, 10, 8, 1, 1, 2, 8, 14, 21, 30, 20, 20, 5, 2, 1, 2, 9, 16, 28, 42, 35, 40, 15, 10, 1, 1, 2, 10, 18, 36, 56, 56, 70, 35, 30, 6, 2
Offset: 0

Views

Author

Peter Luschny, Jul 22 2024

Keywords

Comments

There are several versions of Lucas and Fibonacci polynomials in this database. Our naming follows the convention of calling polynomials after the values of the polynomials at x = 1. This assumes a regular sequence of polynomials, that is, a sequence of polynomials where degree(p(n)) = n. This view makes the coefficients of the polynomials (the terms of a row) a refinement of the values at the unity.
A remarkable property of the polynomials under consideration is that they are dual in this respect. This means they give the Lucas numbers at x = 1 and the Fibonacci numbers at x = -1 (except for the sign). See the example section.
The Pell numbers and the dual Pell numbers are also values of the polynomials, at the points x = -1/2 and x = 1/2 (up to the normalization factor 2^n). This suggests a harmonized terminology: To call 2^n*P(n, -1/2) = 1, 0, 1, 2, 5, ... the Pell numbers (A000129) and 2^n*P(n, 1/2) = 1, 4, 9, 22, ... the dual Pell numbers (A048654).
Based on our naming convention one could call A162515 (without the prepended 0) the Fibonacci polynomials. In the definition above only the initial values would change to: T(n, k) = k + 1 for k < 1. To extend this line of thought we introduce A374438 as the third triangle of this family.
The triangle is closely related to the qStirling2 numbers at q = -1. For the definition of these numbers see A333143. This relates the triangle to A065941 and A103631.

Examples

			Triangle starts:
  [ 0] [1]
  [ 1] [1, 2]
  [ 2] [1, 2, 1]
  [ 3] [1, 2, 2,  2]
  [ 4] [1, 2, 3,  4,  1]
  [ 5] [1, 2, 4,  6,  3,  2]
  [ 6] [1, 2, 5,  8,  6,  6,  1]
  [ 7] [1, 2, 6, 10, 10, 12,  4,  2]
  [ 8] [1, 2, 7, 12, 15, 20, 10,  8,  1]
  [ 9] [1, 2, 8, 14, 21, 30, 20, 20,  5,  2]
  [10] [1, 2, 9, 16, 28, 42, 35, 40, 15, 10, 1]
.
Table of interpolated sequences:
  |  n | A039834 & A000045 | A000032 |   A000129   |   A048654  |
  |  n |     -P(n,-1)      | P(n,1)  |2^n*P(n,-1/2)|2^n*P(n,1/2)|
  |    |     Fibonacci     |  Lucas  |     Pell    |    Pell*   |
  |  0 |        -1         |     1   |       1     |       1    |
  |  1 |         1         |     3   |       0     |       4    |
  |  2 |         0         |     4   |       1     |       9    |
  |  3 |         1         |     7   |       2     |      22    |
  |  4 |         1         |    11   |       5     |      53    |
  |  5 |         2         |    18   |      12     |     128    |
  |  6 |         3         |    29   |      29     |     309    |
  |  7 |         5         |    47   |      70     |     746    |
  |  8 |         8         |    76   |     169     |    1801    |
  |  9 |        13         |   123   |     408     |    4348    |
		

Crossrefs

Triangles related to Lucas polynomials: A034807, A114525, A122075, A061896, A352362.
Triangles related to Fibonacci polynomials: A162515, A053119, A168561, A049310, A374441.
Sums include: A000204 (Lucas numbers, row), A000045 & A212804 (even sums, Fibonacci numbers), A006355 (odd sums), A039834 (alternating sign row).
Type m^n*P(n, 1/m): A000129 & A048654 (Pell, m=2), A108300 & A003688 (m=3), A001077 & A048875 (m=4).
Adding and subtracting the values in a row of the table (plus halving the values obtained in this way): A022087, A055389, A118658, A052542, A163271, A371596, A324969, A212804, A077985, A069306, A215928.
Columns include: A040000 (k=1), A000027 (k=2), A005843 (k=3), A000217 (k=4), A002378 (k=5).
Diagonals include: A000034 (k=n), A029578 (k=n-1), abs(A131259) (k=n-2).
Cf. A029578 (subdiagonal), A124038 (row reversed triangle, signed).

Programs

  • Magma
    function T(n,k) // T = A374439
      if k lt 0 or k gt n then return 0;
      elif k le 1 then return k+1;
      else return T(n-1,k) + T(n-2,k-2);
      end if;
    end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jan 23 2025
    
  • Maple
    A374439 := (n, k) -> ifelse(k::odd, 2, 1)*binomial(n - irem(k, 2) - iquo(k, 2), iquo(k, 2)):
    # Alternative, using the function qStirling2 from A333143:
    T := (n, k) -> 2^irem(k, 2)*qStirling2(n, k, -1):
    seq(seq(T(n, k), k = 0..n), n = 0..10);
  • Mathematica
    A374439[n_, k_] := (# + 1)*Binomial[n - (k + #)/2, (k - #)/2] & [Mod[k, 2]];
    Table[A374439[n, k], {n, 0, 10}, {k, 0, n}]//Flatten (* Paolo Xausa, Jul 24 2024 *)
  • Python
    from functools import cache
    @cache
    def T(n: int, k: int) -> int:
        if k > n: return 0
        if k < 2: return k + 1
        return T(n - 1, k) + T(n - 2, k - 2)
    
  • Python
    from math import comb as binomial
    def T(n: int, k: int) -> int:
        o = k & 1
        return binomial(n - o - (k - o) // 2, (k - o) // 2) << o
    
  • Python
    def P(n, x):
        if n < 0: return P(n, x)
        return sum(T(n, k)*x**k for k in range(n + 1))
    def sgn(x: int) -> int: return (x > 0) - (x < 0)
    # Table of interpolated sequences
    print("|  n | A039834 & A000045 | A000032 |   A000129   |   A048654  |")
    print("|  n |     -P(n,-1)      | P(n,1)  |2^n*P(n,-1/2)|2^n*P(n,1/2)|")
    print("|    |     Fibonacci     |  Lucas  |     Pell    |    Pell*   |")
    f = "| {0:2d} | {1:9d}         |  {2:4d}   |   {3:5d}     |    {4:4d}    |"
    for n in range(10): print(f.format(n, -P(n, -1), P(n, 1), int(2**n*P(n, -1/2)), int(2**n*P(n, 1/2))))
    
  • SageMath
    from sage.combinat.q_analogues import q_stirling_number2
    def A374439(n,k): return (-1)^((k+1)//2)*2^(k%2)*q_stirling_number2(n+1, k+1, -1)
    print(flatten([[A374439(n, k) for k in range(n+1)] for n in range(13)])) # G. C. Greubel, Jan 23 2025

Formula

T(n, k) = 2^k' * binomial(n - k' - (k - k') / 2, (k - k') / 2) where k' = 1 if k is odd and otherwise 0.
T(n, k) = (1 + (k mod 2))*qStirling2(n, k, -1), see A333143.
2^n*P(n, -1/2) = A000129(n - 1), Pell numbers, P(-1) = 1.
2^n*P(n, 1/2) = A048654(n), dual Pell numbers.
T(2*n, n) = (1/2)*(-1)^n*( (1+(-1)^n)*A005809(n/2) - 2*(1-(-1)^n)*A045721((n-1)/2) ). - G. C. Greubel, Jan 23 2025

A139382 Triangle read by rows, T(n,k) = (2^k-1) * T(n-1,k) + T(n-1,k-1).

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 1, 13, 11, 1, 1, 40, 90, 26, 1, 1, 121, 670, 480, 57, 1, 1, 364, 4811, 7870, 2247, 120, 1, 1, 1093, 34041, 122861, 77527, 9807, 247, 1, 1, 3280, 239380, 1876956, 2526198, 695368, 41176, 502, 1, 1, 9841, 1678940, 28393720, 80189094, 46334382, 5924720, 169186, 1013, 1
Offset: 1

Views

Author

Gary W. Adamson, Apr 16 2008

Keywords

Comments

Row sums = A135922 starting with offset 1: (1, 2, 6, 26, 158, 1330, ...).
This triangle is the q-analog of A008277 (Stirling numbers of the 2nd kind) for q=2 (see Cai et al. link). - Werner Schulte, Apr 04 2019
T(n,k) is the number of naturally labeled posets on [n] with height at most one containing exactly k minimal elements. See link by David Bevan and others below. - Geoffrey Critzer, May 03 2025

Examples

			First few rows of the triangle are:
  1;
  1,   1;
  1,   4,   1;
  1,  13,  11,   1;
  1,  40,  90,  26,   1;
  1, 121, 670, 480,  57,   1;
  ...
a(13) = T(5,3) = 90 = (2^3 - 1)*T(4,3) + T(4,2) = 7*11 + 13.
		

Crossrefs

Cf. A000295 (2nd diagonal), A003462 (column 2), A016212 (column 3), A156823.

Programs

  • Maple
    # Uses[qStirling2 from A333143]
    seq(seq(qStirling2(n, k, 2), k=0..n), n=0..9); # Peter Luschny, Mar 10 2020
    # Alternative.
    A139382 := proc(n, k) if k = 1 then 1 elif k = n then 1 elif k < 1 then 0 else
    (2^k - 1)*A139382(n-1, k) + A139382(n-1, k-1) fi end:
    for n from 1 to 8 do seq(A139382(n, k), k = 1..n) od; # Peter Luschny, Jun 28 2022
  • Mathematica
    T[1, 1]:= 1; T[n_, k_]:= T[n, k] = If[k > n || k < 1, 0, (2^k-1)*T[n-1, k] + T[n-1, k-1]]; Table[T[n, k], {n, 1, 12}, {k, 1, n}] (* G. C. Greubel, Apr 02 2019 *)
  • PARI
    {T(n,k) = if(k<1 || k>n, 0, if(n==1 && k==1, 1, (2^k-1)*T(n-1,k) + T(n-1,k-1)))};
    for(n=1,12, for(k=1,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Apr 02 2019
    
  • Sage
    @CachedFunction
    def T(n, k):
       if (k==1): return 1
       elif (k==n): return 1
       else: return (2^k-1)*T(n-1, k) + T(n-1, k-1)
    [[T(n, k) for k in (1..n)] for n in (1..12)] # G. C. Greubel, Apr 02 2019

Formula

Triangle read by rows, T(n,k) = (2^k-1) * T(n-1,k) + T(n-1,k-1). Let X = an infinite bidiagonal matrix with (1,3,7,15,31...) in the main diagonal and (1,1,1,...) in the subdiagonal. n-th row of the triangle = X^n * [1,0,0,0,...].
From Werner Schulte, Apr 02 2019: (Start)
G.f. of column k: col(k,t) = Sum_{n>=k} T(n,k)*t^n = t^k/Product_{i=1..k} (1 - (2^i-1)*t) for k > 0.
Sum_{k>0} col(k,t) * (Product_{i=1..k-1} (1 - 2^i)) = t (empty product equals 1).
Sum_{k=1..n} (-1)^k * 2^binomial(k,2) * T(n,k) = (-1)^n for n > 0.
An example for k=3: g.f. of column 3: col(3,t) = Sum_{n>=3} T(n,3) * t^n = 1*t^3 + 11*t^4 + 90*t^5 + 670*t^6 + ... = t^3 * (1 + 11*t + 90*t^2 + 670*t^3 + ...) = t^3 / Product_{i=1..3} (1 - (2^i - 1)*t) = t^3 / ((1 - t) * (1 - 3*t) * (1 - 7*t)) = t^3 / (1 - 11*t + 31*t^2 - 21*t^3). Perhaps the following recurrence formula is useful too: col(k,t) = col(k-1,t) * t / (1 - (2^k - 1)*t) for k > 1 with initial value col(1,t) = t / (1 - t). Finally: col(k,t) is the g.f. of column k.
With regard to the 2nd formula: We can it replace with the following formula: Sum_{k=1..n} T(n,k) * (Product_{i=1..k-1} (1-2^i)) = A000007(n-1) for n > 0 with empty product 1 (case k=1). Example for n=5: 1*1 + (-1)*40 + (-1)*(-3)*90 + (-1)*(-3)*(-7)*26 + (-1)*(-3)*(-7)*(-15)*1 = 0. (End)
T(n,k) = (1/(2^binomial(k,2)*A005329(k))) * Sum_{j=0..k} (-1)^(k-j)*2^binomial(k-j,2)*A022166(k,j)*(2^j-1)^n. - Fabian Pereyra, Jan 27 2024
T(n,k) = Sum_{j=k..n} (-1)^(n-j)*binomial(n,j)*qBinomial(j,k,2), where qBinomial(n,k,2) is A022166(n,k). - Fabian Pereyra, Jan 31 2024

Extensions

More terms from G. C. Greubel, Apr 02 2019

A333142 Triangle read by rows: T(n, k) = qStirling1(n, k, q) for q = 2, with 0 <= k <= n.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 7, 5, 1, 1, 50, 42, 12, 1, 1, 751, 680, 222, 27, 1, 1, 23282, 21831, 7562, 1059, 58, 1, 1, 1466767, 1398635, 498237, 74279, 4713, 121, 1, 1, 186279410, 179093412, 64674734, 9931670, 672830, 20080, 248, 1
Offset: 0

Views

Author

Peter Luschny, Mar 09 2020

Keywords

Examples

			Triangle starts:
[0] 1
[1] 1, 1
[2] 1, 2,         1
[3] 1, 7,         5,         1
[4] 1, 50,        42,        12,       1
[5] 1, 751,       680,       222,      27,      1
[6] 1, 23282,     21831,     7562,     1059,    58,     1
[7] 1, 1466767,   1398635,   498237,   74279,   4713,   121,   1
[8] 1, 186279410, 179093412, 64674734, 9931670, 672830, 20080, 248, 1
		

Crossrefs

T(n,n-1) = A000325(n).
Cf. A333143.

Programs

  • Maple
    qStirling1 := proc(n, k, q) option remember; with(QDifferenceEquations):
    if n = 0 then return 0^k fi; if k = 0 then return n^0 fi;
    qStirling1(n-1, k-1, p) + QBrackets(n-1, p)*qStirling1(n-1, k, p);
    subs(p = q, expand(%)) end:
    seq(seq(qStirling1(n, k, 2), k=0..n), n=0..9);

Formula

qStirling1(n, k, q) = qStirling1(n-1, k-1, q) + qBrackets(n-1, q)*qStirling1(n-1, k, q) with boundary values 0^k if n = 0 and n^0 if k = 0.
Note that also a second definition is used in the literature. The two versions differ by a factor of q^(n-k).

A342186 Triangle read by rows, matrix inverse of A139382.

Original entry on oeis.org

1, -1, 1, 3, -4, 1, -21, 31, -11, 1, 315, -486, 196, -26, 1, -9765, 15381, -6562, 1002, -57, 1, 615195, -978768, 428787, -69688, 4593, -120, 1, -78129765, 124918731, -55434717, 9279163, -652999, 19833, -247, 1
Offset: 1

Views

Author

John Keith, Mar 04 2021

Keywords

Comments

This triangle appears to be the q-analog of A008275 (Stirling numbers of the first kind) for q=2. However, A333142 has a similar definition.
Row sums of unsigned triangle are A006125 with offset 1.
|T(n,k)| is the number of descent free digraphs on [n] containing exactly k source nodes. A descent in a digraph is a pair of vertices s->t such that s>t. A descent free digraph is necessarily acyclic. A source in an acyclic digraph is a node with indegree 0. - Geoffrey Critzer, Mar 05 2025

Examples

			The triangle begins:
           1;
          -1,         1;
           3,        -4,         1;
         -21,        31,       -11,       1;
         315,      -486,       196,     -26,       1;
       -9765,     15381,     -6562,    1002,     -57,     1;
      615195,   -978768,    428787,  -69688,    4593,  -120,    1;
   -78129765, 124918731, -55434717, 9279163, -652999, 19833, -247, 1;
  ...
		

Crossrefs

Cf. A008275, A139382, A333142, A333143, A006125 (row sums).
Columns of unsigned triangle: A005329, A203011, A000295, A203242.

Programs

  • Maple
    A342186 := proc(n, k) if n = 1 and k = 1 then 1 elif k > n or k < 1 then 0 else
    A342186(n-1, k-1) - (2^(n-1) - 1) * A342186(n-1, k) fi end:
    for n from 1 to 8 do seq(A342186(n, k), k = 1..n) od; # Peter Luschny, Jun 28 2022
  • Mathematica
    T[1, 1] := 1; T[n_, k_] := T[n, k] = If[k > n || k < 1, 0, T[n - 1, k - 1] - (2^(n - 1) - 1)*T[n - 1, k]]; Table[T[n, k], {n, 1, 8}, {k, 1, n}] (* after G. C. Greubel's program for A139382 *)
  • PARI
    mat(nn) = my(m = matrix(nn, nn)); for (n=1, nn, for(k=1, nn, m[n,k] = if (n==1, if (k==1, 1, 0), if (k==1, 1, (2^k-1)*m[n-1, k] + m[n-1, k-1])););); m; \\ A139382
    tabl(nn) = 1/mat(nn); \\ Michel Marcus, Mar 18 2021

Formula

T(n,k) = T(n-1,k-1) - (2^(n-1)-1) * T(n-1,k), n, k >= 1, T(1, 1) = 1, T(n, 0) = 0.
For unsigned triangle, T(n, 1) = A005329(n-1); T(n, 2) = A203011(n-1); T(n, n-1) = A000295(n+1); T(n, n-2) = A203242(n-1).
T(n,k) = Sum_{j=k..n} (-1)^(n-j)*2^binomial(n-j,2)*qBinomial(n,j,2)*binomial(j,k), where qBinomial(n,k,2) is A022166(n,k). - Fabian Pereyra, Feb 08 2024

A355282 Triangle read by rows: T(n, k) = Sum_{i=1..n-k} qStirling1(n-k, i) * qStirling2(n-1+i, n-1) for 0 < k < n with initial values T(n, 0) = 0^n and T(n, n) = 1 for n >= 0, here q = 2.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 9, 4, 1, 0, 343, 79, 11, 1, 0, 50625, 6028, 454, 26, 1, 0, 28629151, 1741861, 68710, 2190, 57, 1, 0, 62523502209, 1926124954, 38986831, 656500, 9687, 120, 1, 0, 532875860165503, 8264638742599, 84816722571, 734873171, 5760757, 40929, 247, 1
Offset: 0

Views

Author

Werner Schulte, Jun 26 2022

Keywords

Comments

We aim at a q-generalization of the Comtet-Lehmer numbers A354794, which are the case q = 1. Here we consider the case q = 2. The generalization is based on the qStirling numbers, for qStirling1 see A342186 and for qStirling2 see A139382. The general construction is as follows:
Let q <> 1 be a fixed integer and f_q(k) = (q^k - 1)/(q - 1) for k >= 0. Define triangle M(q; n, k) for 0 <= k <= n by M(q; n, 0) = 0^n for n >= 0, and M(q; n, k) = 0 for k > n, and M(q; n, k) = M(q; n-1, k-1) + M(q; n-1, k) * f_q(k) for 0 < k <= n. Then M(q; n, n) = 1 for n >= 0 and the matrix inverse I_q = M_q^(-1) exists. Next define the triangle T(q; n, k) for 0 <= k <= n by T(q; n, 0) = 0^n for n >= 0 and T(q; n, k) = Sum_{i=0..n-k} I(q; n-k, i) * M(q; n-1+i, n-1) for 0 < k <= n. Take account of lim_{q->1} (q^n - 1)/(q - 1) = n for n >= 0.
Conjecture: T(q; n+1, 1) = Sum_{i=0..n} I(q; n, i) * M(q; n+i, n) = (f_q(n))^n = ((q^n - 1)/(q - 1))^n for n >= 0.
Conjecture: T(q; n, k) = (Sum_{i=0..n-k} (-1)^i * q-binomial(n-1-i, k-1) * binomial(n-1, i) * q^((n-k)*(n-k-i))) / (q - 1)^(n-k) for 0 < k <= n.

Examples

			Triangle T(n, k) for 0 <= k <= n starts:
n\k : 0               1             2           3         4       5     6   7 8
===============================================================================
  0 : 1
  1 : 0               1
  2 : 0               1             1
  3 : 0               9             4           1
  4 : 0             343            79          11         1
  5 : 0           50625          6028         454        26       1
  6 : 0        28629151       1741861       68710      2190      57     1
  7 : 0     62523502209    1926124954    38986831    656500    9687   120   1
  8 : 0 532875860165503 8264638742599 84816722571 734873171 5760757 40929 247 1
  etc.
		

Crossrefs

Cf. A022166, A139382, A342186, A354794, A055601 (column 1), A125128 (1st subdiagonal).

Programs

  • Maple
    # using qStirling2 from A333143.
    A355282 := proc(n, k) if k = 0 then 0^n elif n = k then 1 else
    add(A342186(n - k, i)*qStirling2(n + i - 2, n - 2, 2), i = 1..n-k) fi end:
    seq(print(seq(A355282(n, k), k = 0..n)), n = 0..8); # Peter Luschny, Jun 28 2022
  • PARI
    mat(nn) = my(m = matrix(nn, nn)); for (n=1, nn, for(k=1, nn, m[n, k] = if (n==1, if (k==1, 1, 0), if (k==1, 1, (2^k-1)*m[n-1, k] + m[n-1, k-1])); ); ); m; \\ A139382
    tabl(nn) = my(m=mat(3*nn), im=1/m); matrix(nn, nn, n, k, n--; k--; if (k==0, 0^n, kMichel Marcus, Jun 27 2022

Formula

Conjecture: T(n+1, 1) = (2^n - 1)^n for n >= 0.
Conjecture: T(n, k) = Sum_{i=0..n-k} (-1)^i * binomial(n-1, i) * [n-1-i, k-1]_2 * 2^((n-k)*(n-k-i)) for 0 < k <= n and T(n, 0) = 0^n for n >= 0, where [x, y]_2 = A022166(x, y).

A374429 Triangle read by rows: T(n, k) = ((3*(-1)^k + 1)/2)*abs(qStirling2(n, k, -1)). Polynomials related to the Lucas and Fibonacci numbers.

Original entry on oeis.org

2, 0, -1, 0, -1, 2, 0, -1, 2, -1, 0, -1, 2, -2, 2, 0, -1, 2, -3, 4, -1, 0, -1, 2, -4, 6, -3, 2, 0, -1, 2, -5, 8, -6, 6, -1, 0, -1, 2, -6, 10, -10, 12, -4, 2, 0, -1, 2, -7, 12, -15, 20, -10, 8, -1, 0, -1, 2, -8, 14, -21, 30, -20, 20, -5, 2
Offset: 0

Views

Author

Peter Luschny, Jul 25 2024

Keywords

Comments

The idea behind the Fibonacci and Lucas sequences is simple: Put the '2' in the middle of a band and place a '1' to the left and a '-1' to the right. Now add the sum of the two immediate numbers with higher indexes on the left side and on the right side the sum of the two with lower indexes. Schematically, after a few steps, it looks like this:
..., 18, 11, 7, 4, 3, 1, <-- + [2] + --> -1, 1, 0, 1, 1, 2, 3, 5, ...
This generates the Lucas sequence on the left (with a descending index) and the Fibonacci sequence on the right (with an ascending index). The fact that the first two terms (-1, 1) of the Fibonacci sequence were 'forgotten' in A000045 is from our point of view only a difference in the choice of the offset of the central term. Our choice is, in any case, consistent with Knuth's continuation of the Fibonacci numbers into the negative range (A039834).
This construction is to be captured in a family of polynomials. The idea is that the two sequences are the values of the polynomials at the points x = -1 and x = 1. This continues from A374439. Here we choose signed coefficients and shift the powers up by one.
This approach also reveals that another important sequence follows the same logic: the Pell numbers (A000129). These, and their dual counterpart A048654, are interpolated by the polynomials at the points x = 1/2 and x = -1/2 (up to the normalization factor 2^n). The table in the example section gives an overview.
The formal representation is based on the qStirling2 numbers in the version defined in SageMath (see also A065941 and A333143).

Examples

			Triangle starts:
  [0] [2]
  [1] [0, -1]
  [2] [0, -1, 2]
  [3] [0, -1, 2, -1]
  [4] [0, -1, 2, -2,  2]
  [5] [0, -1, 2, -3,  4,  -1]
  [6] [0, -1, 2, -4,  6,  -3,  2]
  [7] [0, -1, 2, -5,  8,  -6,  6,  -1]
  [8] [0, -1, 2, -6, 10, -10, 12,  -4, 2]
  [9] [0, -1, 2, -7, 12, -15, 20, -10, 8, -1]
.
Table of interpolated sequences:
  |    | A039834 & A000045 | A000032 |   A000129  |   A048654  |
  |  n |      P(n, 1)      | P(n,-1) |-2^nP(n,1/2)|2^nP(n,-1/2)|
  |    |     Fibonacci     |  Lucas  |    Pell    |    Pell*   |
  |  1 |        -1         |    1    |       1    |       1    |
  |  2 |         1         |    3    |       0    |       4    |
  |  3 |         0         |    4    |       1    |       9    |
  |  4 |         1         |    7    |       2    |      22    |
  |  5 |         1         |   11    |       5    |      53    |
  |  6 |         2         |   18    |      12    |     128    |
  |  7 |         3         |   29    |      29    |     309    |
  |  8 |         5         |   47    |      70    |     746    |
  |  9 |         8         |   76    |     169    |    1801    |
  | 10 |        13         |  123    |     408    |    4348    |
		

Crossrefs

Cf. A000045 (Fibonacci), A039834 (negaFibonacci), A000204 (Lucas), A000129 (Pell), A048654 (dual Pell), A065941 (qStirling2).
Cf. A374439 (variant).

Programs

  • SageMath
    from sage.combinat.q_analogues import q_stirling_number2
    def T(n, k):
        return ((3*(-1)^k + 1)//2)*abs(q_stirling_number2(n, k, -1))
    for n in range(10): print([T(n, k) for k in range(n + 1)])
    def P(n, x):
        if n < 0: return P(-n, -x)
        return sum(T(n, k)*x^k for k in range(n + 1))
    # Lucas and Fibonacci combined
    print([P(n, 1) for n in range(-6, 9)])
    # Table of interpolated sequences
    print("|    | A039834 & A000045 | A000032 |   A000129  |   A048654  |")
    print("|  n |      P(n, 1)      | P(n,-1) |-2^nP(n,1/2)|2^nP(n,-1/2)|")
    f = "| {0:2d} | {1:9d}         | {2:4d}    | {3:7d}    | {4:7d}    |"
    for n in range(1, 11): print(f.format(n, P(n, 1), P(n, -1),
                           int(-2**n*P(n, 1/2)), int(2**n*P(n, -1/2))))
Showing 1-8 of 8 results.