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-10 of 11 results. Next

A145153 Square array A(n,k), n >= 0, k >= 0, read by antidiagonals, where sequence a_k of column k is the expansion of x/((1 - x - x^4)*(1 - x)^(k - 1)).

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 2, 1, 0, 0, 1, 3, 3, 1, 1, 0, 1, 4, 6, 4, 2, 1, 0, 1, 5, 10, 10, 6, 3, 1, 0, 1, 6, 15, 20, 16, 9, 4, 1, 0, 1, 7, 21, 35, 36, 25, 13, 5, 2, 0, 1, 8, 28, 56, 71, 61, 38, 18, 7, 3, 0, 1, 9, 36, 84, 127, 132, 99, 56, 25, 10, 4, 0, 1, 10, 45, 120, 211, 259, 231, 155, 81, 35, 14, 5
Offset: 0

Views

Author

Alois P. Heinz, Oct 03 2008

Keywords

Comments

Each row sequence a_n (for n > 0) is produced by a polynomial of degree n-1, whose (rational) coefficients are given in row n of A145140/A145141. The coefficients *(n-1)! are given in A145142.
Each column sequence a_k is produced by a recursion, whose coefficients are given by row k of A145152.

Examples

			Square array A(n,k) begins:
  0, 0, 0,  0,  0,  0,   0, ...
  1, 1, 1,  1,  1,  1,   1, ...
  0, 1, 2,  3,  4,  5,   6, ...
  0, 1, 3,  6, 10, 15,  21, ...
  0, 1, 4, 10, 20, 35,  56, ...
  1, 2, 6, 16, 36, 71, 127, ...
		

Crossrefs

Columns 0-9 give: A017898(n-1) for n>0, A003269, A098578, A145131, A145132, A145133, A145134, A145135, A145136, A145137.
Main diagonal gives: A145138.
Antidiaginal sums give: A145139.
Numerators/denominators of polynomials for rows give: A145140/A145141.

Programs

  • Maple
    A:= proc(n, k) coeftayl (x/ (1-x-x^4)/ (1-x)^(k-1), x=0, n) end:
    seq(seq(A(n, d-n), n=0..d), d=0..13);
  • Mathematica
    a[n_, k_] := SeriesCoefficient[x/(1 - x - x^4)/(1 - x)^(k - 1), {x, 0, n}]; Table[a[n - k, k], {n, 0, 12}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Dec 05 2013 *)

Formula

G.f. of column k: x/((1-x-x^4)*(1-x)^(k-1)).

A145142 Triangle T(n,k), n>=1, 0<=k<=n-1, read by rows: T(n,k)/(n-1)! is the coefficient of x^k in polynomial p_n for the n-th row sequence of A145153.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 2, 3, 1, 24, 6, 11, 6, 1, 120, 144, 50, 35, 10, 1, 720, 1200, 634, 225, 85, 15, 1, 5040, 9960, 6804, 2464, 735, 175, 21, 1, 80640, 89040, 71868, 29932, 8449, 1960, 322, 28, 1, 1088640, 1231776, 789984, 375164, 112644, 25473, 4536, 546, 36, 1
Offset: 1

Views

Author

Alois P. Heinz, Oct 03 2008

Keywords

Examples

			Triangle begins:
    1;
    0,   1;
    0,   1,   1;
    0,   2,   3,   1;
   24,   6,  11,   6,   1;
  120, 144,  50,  35,  10,  1;
		

Crossrefs

T(n,k)/(n-1)! gives: A145140 / A145141.
Diagonal and lower diagonals 1-3 give: A000012, A000217, A000914, A001303.
Row sums are in A052593.

Programs

  • Maple
    row:= proc(n) option remember; local f,i,x; f:= unapply(simplify(sum('cat(a||i) *x^i', 'i'=0..n-1) ), x); unapply(subs(solve({seq(f(i+1)= coeftayl(x/ (1-x-x^4)/ (1-x)^i, x=0, n), i=0..n-1)}, {seq(cat(a||i), i=0..n-1)}), sum('cat(a||i) *x^i', 'i'=0..n-1) ), x); end: T:= (n,k)-> `if`(k<0 or k>=n,0, coeff(row(n)(x),x,k)*(n-1)!): seq(seq(T(n,k), k=0..n-1), n=1..12);
  • Mathematica
    row[n_] := Module[{f, eq}, f = Function[x, Sum[a[k]*x^k, {k, 0, n-1}]]; eq = Table[f[k+1] == SeriesCoefficient[x/(1-x-x^4)/(1-x)^k, {x, 0, n}], {k, 0, n-1}]; Table[a[k], {k, 0, n-1}] /. Solve[eq] // First]; Table[row[n]*(n-1)!, {n, 1, 12}] // Flatten (* Jean-François Alcover, Feb 04 2014, after Alois P. Heinz *)

Formula

See program.

A145140 Numerators of triangle T(n,k), n>=1, 0<=k<=n - 1, read by rows: T(n,k) is the coefficient of x^k in polynomial p_n for the n-th row sequence of A145153.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 11, 1, 1, 1, 6, 5, 7, 1, 1, 1, 5, 317, 5, 17, 1, 1, 1, 83, 27, 22, 7, 5, 1, 1, 2, 53, 5989, 1069, 1207, 7, 23, 1, 1, 3, 611, 2743, 93791, 149, 1213, 1, 13, 1, 1, 4, 101, 25523, 5419, 20071, 397, 3253, 1, 29, 1, 1, 5, 32419, 11017, 30731, 21757
Offset: 1

Views

Author

Alois P. Heinz, Oct 03 2008

Keywords

Examples

			1, 0, 1, 0, 1/2, 1/2, 0, 1/3, 1/2, 1/6, 1, 1/4, 11/24, 1/4, 1/24, 1, 6/5, 5/12, 7/24, 1/12, 1/120, 1, 5/3, 317/360, 5/16, 17/144, 1/48, 1/720 ... = A145140/A145141
As triangle:
  1
  0 1
  0 1/2 1/2
  0 1/3 1/2 1/6
  1 1/4 11/24 1/4 1/24
  1 6/5 5/12 7/24 1/12 1/120
		

Crossrefs

Denominators of T(n, k): A145141. T(n, k)*(n-1)!: A145142.
Row sums give: A003269, A017898(n+3).

Programs

  • Maple
    row:= proc(n) option remember; local f,i,x; f:= unapply(simplify(sum('cat(a||i) *x^i', 'i'=0..n-1) ), x); unapply(subs(solve({seq(f(i+1)= coeftayl(x/ (1-x-x^4)/ (1-x)^i, x=0, n), i=0..n-1)}, {seq(cat(a||i), i=0..n-1)}), sum('cat(a||i) *x^i', 'i'=0..n-1) ), x); end: T:= (n,k)-> coeff(row(n)(x), x, k): seq(seq(numer(T(n,k)), k=0..n-1), n=1..14);
  • Mathematica
    row[n_] := Module[{f, eq}, f = Function[x, Sum[a[k]*x^k, {k, 0, n-1}]]; eq = Table[f[k+1] == SeriesCoefficient[x/(1-x-x^4)/(1-x)^k, {x, 0, n}], {k, 0, n-1}]; Table[a[k], {k, 0, n-1}] /. Solve[eq] // First]; Table[row[n] // Numerator, {n, 1, 14}] // Flatten (* Jean-François Alcover, Feb 04 2014, after Alois P. Heinz *)

Formula

See program.

A228401 The number of permutations of length n sortable by 2 block interchanges.

Original entry on oeis.org

1, 2, 6, 24, 120, 540, 1996, 6196, 16732, 40459, 89519, 184185, 356721, 656475, 1156443, 1961563, 3219019, 5130856, 7969228, 12094622, 17977422, 26223198, 37602126, 53082966, 73872046, 101457721, 137660797, 184691431, 245213039, 322413765, 420086085, 542715141
Offset: 1

Views

Author

Vincent Vatter, Aug 21 2013

Keywords

Examples

			The shortest permutations that cannot be sorted by 2 block interchanges are of length 7.
		

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[-(x^8 - 8 x^7 + 28 x^6 - 54 x^5 + 78 x^4 - 42 x^3 + 24 x^2 - 7 x + 1)/(x - 1)^9, {x, 0, 40}], x] (* Bruno Berselli, Aug 22 2013 *)
    LinearRecurrence[{9,-36,84,-126,126,-84,36,-9,1},{1,2,6,24,120,540,1996,6196,16732},40] (* Harvey P. Dale, Dec 31 2019 *)

Formula

G.f.: -x*(x^8 -8*x^7 +28*x^6 -54*x^5 +78*x^4 -42*x^3 +24*x^2 -7*x +1)/(x-1)^9.
a(n) = 1 + n*(n-1)*(n+1)*(n+2)*(3*n^4-10*n^3-11*n^2+50*n+216)/5760. [Bruno Berselli, Aug 22 2013]

A256181 The number of permutations of length n sortable by 3 block interchanges.

Original entry on oeis.org

1, 2, 6, 24, 120, 720, 5040, 32256, 169632, 737364, 2731444, 8875868, 25894376, 69053375, 170694383, 395443223, 866147111, 1806459866, 3608498678, 6937282452, 12887902732, 23216767894, 40675018726, 69480583966, 115975600846, 189528370396, 303753983092
Offset: 1

Views

Author

Vincent Vatter, Apr 03 2015

Keywords

Examples

			The shortest permutations that cannot be sorted by 3 block interchanges are of length 8.
		

Crossrefs

Programs

  • PARI
    Vec(x*(1-11*x+58*x^2-184*x^3+419*x^4-541*x^5+1608*x^6-270*x^7+567*x^8-217*x^9+66*x^10-12*x^11+x^12)/(1-x)^13 + O(x^30)) \\ Colin Barker, Dec 15 2015

Formula

G.f.: -x * (x^12 -12*x^11 +66*x^10 -217*x^9 +567*x^8 -270*x^7 +1608*x^6 -541*x^5 +419*x^4 -184*x^3 +58*x^2 -11*x +1) / (x^13 -13*x^12 +78*x^11 -286*x^10 +715*x^9 -1287*x^8 +1716*x^7 -1716*x^6 +1287*x^5 -715*x^4 +286*x^3 -78*x^2 +13*x -1).

A349839 Triangle T(n,k) built by placing all ones on the left edge, [1,0,0,0] repeated on the right edge, and filling the body using the Pascal recurrence T(n,k) = T(n-1,k) + T(n-1,k-1).

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 3, 3, 1, 1, 1, 4, 6, 4, 2, 0, 1, 5, 10, 10, 6, 2, 0, 1, 6, 15, 20, 16, 8, 2, 0, 1, 7, 21, 35, 36, 24, 10, 2, 1, 1, 8, 28, 56, 71, 60, 34, 12, 3, 0, 1, 9, 36, 84, 127, 131, 94, 46, 15, 3, 0, 1, 10, 45, 120, 211, 258, 225, 140, 61, 18, 3, 0, 1, 11, 55, 165, 331, 469, 483, 365, 201, 79, 21, 3, 1
Offset: 0

Views

Author

Michael A. Allen, Dec 01 2021

Keywords

Comments

This is the m=4 member in the sequence of triangles A007318, A059259, A118923, A349839, A349841 which have all ones on the left side, ones separated by m-1 zeros on the other side, and whose interiors obey Pascal's recurrence.
T(n,k) is the (n,n-k)-th entry of the (1/(1-x^4),x/(1-x)) Riordan array.
For n>0, T(n,n-1) = A008621(n-1).
For n>1, T(n,n-2) = A001972(n-2).
For n>2, T(n,n-3) = A122046(n).
Sums of rows give A115451.
Sums of antidiagonals give A349840.

Examples

			Triangle begins:
  1;
  1,   0;
  1,   1,   0;
  1,   2,   1,   0;
  1,   3,   3,   1,   1;
  1,   4,   6,   4,   2,   0;
  1,   5,  10,  10,   6,   2,   0;
  1,   6,  15,  20,  16,   8,   2,   0;
  1,   7,  21,  35,  36,  24,  10,   2,   1;
  1,   8,  28,  56,  71,  60,  34,  12,   3,   0;
  1,   9,  36,  84, 127, 131,  94,  46,  15,   3,   0;
  1,  10,  45, 120, 211, 258, 225, 140,  61,  18,   3,   0;
  1,  11,  55, 165, 331, 469, 483, 365, 201,  79,  21,   3,   1;
		

Crossrefs

Other members of sequence of triangles: A007318, A059259, A118923, A349841.

Programs

  • Mathematica
    Flatten[Table[CoefficientList[Series[(1-x*y)/((1-(x*y)^4)(1 - x - x*y)), {x, 0, 24}, {y, 0, 12}], {x, y}][[n+1,k+1]],{n,0,12},{k,0,n}]]

Formula

G.f.: (1-x*y)/((1-(x*y)^4)(1-x-x*y)) in the sense that T(n,k) is the coefficient of x^n*y^k in the series expansion of the g.f.
T(n,0) = 1.
T(n,n) = delta(n mod 4,0).
T(n,1) = n-1 for n>0.
T(n,2) = (n-1)*(n-2)/2 for n>1.
T(n,3) = (n-1)*(n-2)*(n-3)/6 for n>2.
T(n,4) = C(n-1,4) + 1 for n>3.
T(n,5) = C(n-1,5) + n - 5 for n>4.
For 0 <= k < n, T(n,k) = (n-k)*Sum_{j=0..floor(k/4)} binomial(n-4*j,n-k)/(n-4*j).
The g.f. of the n-th subdiagonal is 1/((1-x^4)(1-x)^n).

A145138 Main diagonal of square array A145153.

Original entry on oeis.org

0, 1, 2, 6, 20, 71, 259, 960, 3597, 13586, 51635, 197223, 756380, 2910707, 11233311, 43460144, 168502849, 654547456, 2546819347, 9924285801, 38723794820, 151278566731, 591628491483, 2316065644414, 9074988880769, 35587925333525, 139666503235814, 548516611541343
Offset: 0

Views

Author

Alois P. Heinz, Oct 03 2008

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> coeftayl(x/(1-x-x^4)/(1-x)^(n-1), x=0, n):
    seq(a(n), n=0..30);
    # second Maple program:
    a:= proc(n) option remember; `if`(n<5, n*(n+1)*(n^2-4*n+6)/6,
           a(n-4)+(2*(35*n^3-207*n^2+310*n-78)*a(n-1)-(203*n^3
           -1244*n^2+1891*n-130)*a(n-2)+(2*n-7)*(7*n-19)*n*
           (10*a(n-3)-2*a(n-5)))/((7*n-26)*(n-1)^2))
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Aug 18 2019
  • Mathematica
    a[n_] := SeriesCoefficient[x/(1-x-x^4)/(1-x)^(n-1), {x, 0, n}];
    Table[a[n], {n, 0, 30}] (* Jean-François Alcover, May 10 2022 *)

Formula

a(n) = [x^n] x/((1-x-x^4)*(1-x)^(n-1)).

A145139 Antidiagonal sums of A145153.

Original entry on oeis.org

0, 1, 1, 2, 4, 9, 18, 36, 72, 145, 291, 583, 1167, 2336, 4675, 9354, 18713, 37433, 74876, 149766, 299551, 599128, 1198292, 2396634, 4793337, 9586769, 19173669, 38347519, 76695288, 153390921, 306782318, 613565293, 1227131493, 2454264238
Offset: 0

Views

Author

Alois P. Heinz, Oct 03 2008

Keywords

Crossrefs

Programs

  • GAP
    a:=[0,1,1,2,4];; for n in [6..40] do a[n]:=3*a[n-1]-2*a[n-2]+a[n-4] -2*a[n-5]; od; a; # G. C. Greubel, May 21 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 40); [0] cat Coefficients(R!( x*(1-x)^2/((1-2*x)*(1-x-x^4)) )); // G. C. Greubel, May 21 2019
    
  • Maple
    a:= n-> (Matrix([[4, 2, 1, 1, 0]]). Matrix (5, (i,j)-> if i=j-1 then 1 elif j=1 then [3, -2, 0, 1, -2][i] else 0 fi)^n)[1,5]: seq(a(n), n=0..40);
  • Mathematica
    CoefficientList[Series[x*(1-x)^2/((1-2*x)*(1-x-x^4)), {x, 0, 40}], x] (* Vincenzo Librandi, Jun 06 2013 *)
  • PARI
    my(x='x+O('x^40)); concat([0], Vec(x*(1-x)^2/((1-2*x)*(1-x-x^4)))) \\ G. C. Greubel, May 21 2019
    
  • Sage
    (x*(1-x)^2/((1-2*x)*(1-x-x^4))).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, May 21 2019
    

Formula

G.f.: x*(1-x)^2 / ((1-2*x)*(1-x-x^4)).

A260695 a(n) is the number of permutations p of {1,..,n} such that the minimum number of block interchanges required to sort the permutation p to the identity permutation is maximized.

Original entry on oeis.org

1, 1, 1, 5, 8, 84, 180, 3044, 8064, 193248, 604800, 19056960, 68428800, 2699672832, 10897286400, 520105017600, 2324754432000, 130859579289600, 640237370572800, 41680704936960000, 221172909834240000, 16397141420298240000, 93666727314800640000, 7809290721329061888000, 47726800133326110720000
Offset: 0

Views

Author

Marion Scheepers, Nov 16 2015

Keywords

Comments

Interweaving of nonzero Hultman numbers A164652(n,k) for k=1 and k=2. - Max Alekseyev, Nov 20 2020

Examples

			The next three lines illustrate applying block interchanges to [2 4 6 1 3 5 7], an element of S_7.
Step 1: [2 4 6 1 3 5 7]->[3 5 1 2 4 6 7]-interchange blocks 3 5 and 2 4 6.
Step 2: [3 5 1 2 4 6 7]->[4 1 2 3 5 6 7]-interchange blocks 3 5 and 4.
Step 3: [4 1 2 3 5 6 7]->[1 2 3 4 5 6 7]-interchange blocks 4 and 1 2 3.
As [2 4 6 1 3 5 7] requires 3 = floor(7/2) block interchanges, it is one of the a(7) = 3044.
Each of the 23 non-identity elements of S_4 requires at least 1 block interchange to sort to the identity. But only 8 of these require 2 block interchanges, the maximum number required for elements of S_4. They are: [4 3 2 1], [4 1 3 2], [4 2 1 3], [3 1 4 2], [3 2 4 1], [2 4 1 3], [2 1 4 3], [2 4 3 1]. So, a(4) = 8.
		

Crossrefs

The number of elements of S_n that can be sorted by: a single block interchange (A145126), two block interchanges (A228401), three block interchanges (A256181), context directed block interchanges (A249165).
The number of signed permutations that can be sorted by: context directed reversals (A260511), applying either context directed reversals or context directed block interchanges (A260506).

Programs

  • Mathematica
    a[n_]:=Abs[StirlingS1[n+2,Mod[n,2]+1]/Binomial[n+2,2]]; Array[a,25,0] (* Stefano Spezia, Apr 01 2024 *)
  • PARI
    { A260695(n) = abs(stirling(n+2, n%2+1)) / binomial(n+2, 2); } \\ Max Alekseyev, Nov 20 2020

Formula

For even n, a(n) = 2 * n! / (n+2).
For odd n, a(n) = 2 * n! * H(n+1) / (n+2) = 2 * A000254(n+1) / ((n+1)*(n+2)), where H(n+1) = A001008(n+1)/A002805(n+1) is the (n+1)-st harmonic number.
a(n) = A164652(n, 1+(n mod 2)). - Max Alekseyev, Nov 20 2020

Extensions

Edited and extended by Max Alekseyev incorporating comments from M. Tikhomirov, Nov 20 2020

A323228 a(n) = binomial(n + 4, n - 1) + 1.

Original entry on oeis.org

1, 2, 7, 22, 57, 127, 253, 463, 793, 1288, 2003, 3004, 4369, 6189, 8569, 11629, 15505, 20350, 26335, 33650, 42505, 53131, 65781, 80731, 98281, 118756, 142507, 169912, 201377, 237337, 278257, 324633, 376993, 435898, 501943, 575758, 658009, 749399, 850669
Offset: 0

Views

Author

Peter Luschny, Feb 12 2019

Keywords

Crossrefs

A040000 (m=1), A000027 (m=2), A000124 (m=3), A050407 (m=4), A145126 (m=5), this sequence (m=6).

Programs

  • Maple
    aList := proc(len) local gf, ser:
    gf := (x - (x - 1)^5)/(x - 1)^6:
    ser := series(gf, x, len+2):
    seq(coeff(ser, x, n), n=0..len) end: aList(38);
  • Mathematica
    Table[Binomial[n + 4, n - 1] + 1, {n, 0, 37}]

Formula

a(n) = 1 + Pochhammer(n, 5)/5!.
a(n) = [x^n] (x - (x - 1)^5)/(x - 1)^6.
Showing 1-10 of 11 results. Next