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

A177248 Triangle read by rows: T(n,k) is the number of permutations of [n] having k adjacent transpositions (0 <= k <= floor(n/2)). An adjacent transposition is a cycle of the form (i, i+1).

Original entry on oeis.org

1, 1, 1, 1, 4, 2, 19, 4, 1, 99, 18, 3, 611, 99, 9, 1, 4376, 612, 48, 4, 35621, 4376, 306, 16, 1, 324965, 35620, 2190, 100, 5, 3285269, 324965, 17810, 730, 25, 1, 36462924, 3285270, 162480, 5940, 180, 6, 440840359, 36462924, 1642635, 54160, 1485, 36, 1
Offset: 0

Views

Author

Emeric Deutsch, May 07 2010

Keywords

Comments

Row n contains 1 + floor(n/2) entries.
Sum of entries in row n = n! (A000142).

Examples

			T(5,2)=3 because we have (12)(34)(5), (12)(3)(45), and (1)(23)(45).
Triangle starts:
    1;
    1;
    1,  1;
    4,  2;
   19,  4,  1;
   99, 18,  3;
  611, 99,  9,  1;
		

Crossrefs

Columns k=0..3 give A177249, A370524, A370426, A370529.
Cf. A000142 (row sums).

Programs

  • Magma
    F:=Factorial;
    A177248:= func< n,k | (&+[(-1)^j*F(n-k-j)/(F(k)*F(j)): j in [0..Floor((n-2*k)/2)]]) >;
    [A177248(n,k): k in [0..Floor(n/2)], n in [0..16]]; // G. C. Greubel, Apr 28 2024
    
  • Maple
    T := proc (n, k) options operator, arrow: sum((-1)^(k+j)*binomial(j, k)*factorial(n-j)/factorial(j), j = 0 .. floor((1/2)*n)) end proc: for n from 0 to 12 do seq(T(n, k), k = 0 .. floor((1/2)*n)) end do; # yields sequence in triangular form
  • Mathematica
    T[n_, k_] := Sum[(-1)^(k + j)*Binomial[j, k]*(n - j)!/j!, {j, 0, n/2}];
    Table[T[n, k], {n, 0, 12}, {k, 0, n/2}] // Flatten (* Jean-François Alcover, Nov 20 2017 *)
  • PARI
    T(n, k) = sum(j=0, n\2, (-1)^(k+j)*binomial(j,k)*(n-j)!/j!);
    tabf(nn) = for (n=0, nn, for (k=0, n\2, print1(T(n,k), ", ")); print); \\ Michel Marcus, Nov 21 2017
    
  • SageMath
    f=factorial;
    def A177248(n,k): return sum((-1)^j*f(n-k-j)/(f(k)*f(j)) for j in range(1+(n-2*k)//2))
    flatten([[A177248(n,k) for k in range(1+n//2)] for n in range(17)]) # G. C. Greubel, Apr 28 2024

Formula

T(n, k) = Sum_{j=0..floor(n/2)} (-1)^(k+j)*binomial(j,k)*(n-j)!/j!.
T(n, 0) = A177249(n).
Sum_{k=0..floor(n/2)} k*T(n,k) = (n-1)! (n >= 2).
G.f. of column k: (1/k!) * Sum_{j>=k} j! * x^(j+k) / (1+x^2)^(j+1). - Seiichi Manyama, Feb 24 2024

A370426 Number of permutations of [n] having exactly two adjacent 2-cycles.

Original entry on oeis.org

0, 0, 0, 0, 1, 3, 9, 48, 306, 2190, 17810, 162480, 1642635, 18231465, 220420179, 2883693792, 40592133316, 611765693532, 9828843229764, 167702100599520, 3028466654021205, 57708568527002415, 1157199837194069405, 24358905149602459920, 537053113128448187766
Offset: 0

Views

Author

Seiichi Manyama, Feb 21 2024

Keywords

Crossrefs

Column k=2 of A177248.

Programs

  • PARI
    my(N=30, x='x+O('x^N)); concat([0, 0, 0, 0], Vec(sum(k=2, N, k!*x^(k+2)/(1+x^2)^(k+1))/2))
    
  • PARI
    a(n, k=2, q=2) = sum(j=0, n\q-k, (-1)^j*(n-(q-1)*(j+k))!/j!)/k!;

Formula

G.f.: (1/2) * Sum_{k>=2} k! * x^(k+2) / (1+x^2)^(k+1).
a(n) = (1/2) * Sum_{k=0..floor(n/2)-2} (-1)^k * (n-k-2)! / k!.
a(n) ~ n! / (2*n^2). - Vaclav Kotesovec, May 23 2025

A370529 Number of permutations of [n] having exactly three adjacent 2-cycles.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 4, 16, 100, 730, 5940, 54160, 547540, 6077155, 73473400, 961231264, 13530711096, 203921897844, 3276281076600, 55900700199840, 1009488884673720, 19236189509000805, 385733279064689820, 8119635049867486640, 179017704376149395900
Offset: 0

Views

Author

Seiichi Manyama, Feb 21 2024

Keywords

Crossrefs

Column k=3 of A177248.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<7, [0$6, 1][n+1], ((n-5)*(n-6)*(n-3)*a(n-1)
           -6*(n-4)*a(n-2)+(n-2)*(n-3)*((n-5)*a(n-3)+a(n-4)))/((n-5)*(n-6)))
        end:
    seq(a(n), n=0..25);  # Alois P. Heinz, Feb 21 2024
  • PARI
    my(N=30, x='x+O('x^N)); concat([0, 0, 0, 0, 0, 0], Vec(sum(k=3, N, k!*x^(k+3)/(1+x^2)^(k+1))/6))
    
  • PARI
    a(n, k=3, q=2) = sum(j=0, n\q-k, (-1)^j*(n-(q-1)*(j+k))!/j!)/k!;

Formula

G.f.: (1/6) * Sum_{k>=3} k! * x^(k+3) / (1+x^2)^(k+1).
a(n) = (1/6) * Sum_{k=0..floor(n/2)-3} (-1)^k * (n-k-3)! / k!.
a(n) ~ n! / (6*n^3). - Vaclav Kotesovec, Feb 21 2024

A370527 Triangle read by rows: T(n,k) = number of permutations of [n] having exactly one adjacent k-cycle. (n>=1, 1<=k<=n).

Original entry on oeis.org

1, 0, 1, 3, 2, 1, 8, 4, 2, 1, 45, 18, 6, 2, 1, 264, 99, 22, 6, 2, 1, 1855, 612, 114, 24, 6, 2, 1, 14832, 4376, 696, 118, 24, 6, 2, 1, 133497, 35620, 4923, 714, 120, 24, 6, 2, 1, 1334960, 324965, 39612, 5016, 718, 120, 24, 6, 2, 1, 14684571, 3285270, 357900, 40200, 5034, 720, 120, 24, 6, 2, 1
Offset: 1

Views

Author

Seiichi Manyama, Feb 21 2024

Keywords

Examples

			Triangle starts:
      1;
      0,    1;
      3,    2,   1;
      8,    4,   2,   1;
     45,   18,   6,   2,  1;
    264,   99,  22,   6,  2, 1;
   1855,  612, 114,  24,  6, 2, 1;
  14832, 4376, 696, 118, 24, 6, 2, 1;
		

Crossrefs

Columns k=1..4 give A000240, A370524, A370525, A369098.

Programs

  • PARI
    T(n, k) = sum(j=0, n\k-1, (-1)^j*(n-(k-1)*(j+1))!/j!);

Formula

G.f. of column k: Sum_{j>=1} j! * x^(j+k-1) / (1+x^k)^(j+1).
T(n,k) = Sum_{j=0..floor(n/k)-1} (-1)^j * (n-(k-1)*(j+1))! / j!.
Showing 1-4 of 4 results.