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.

A177250 Triangle read by rows: T(n,k) is the number of permutations of [n] having k adjacent 3-cycles (0 <= k <= floor(n/3)), i.e., having k cycles of the form (i, i+1, i+2).

Original entry on oeis.org

1, 1, 2, 5, 1, 22, 2, 114, 6, 697, 22, 1, 4923, 114, 3, 39612, 696, 12, 357899, 4923, 57, 1, 3588836, 39612, 348, 4, 39556420, 357900, 2460, 20, 475392841, 3588836, 19806, 116, 1, 6187284605, 39556420, 178950, 820, 5, 86701097310, 475392840, 1794420, 6600, 30
Offset: 0

Views

Author

Emeric Deutsch, May 07 2010

Keywords

Comments

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

Examples

			T(7,2)=3 because we have (123)(456)(7), (123)(4)(567), and (1)(234)(567).
Triangle starts:
    1;
    1;
    2;
    5,  1;
   22,  2;
  114,  6;
  697, 22,  1;
		

Crossrefs

Programs

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

Formula

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

Extensions

Crossreferences corrected by Emeric Deutsch, May 09 2010

A370528 Number of permutations of [n] having exactly two adjacent 3-cycles.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 3, 12, 57, 348, 2460, 19806, 178950, 1794420, 19778210, 237696420, 3093642300, 43350548655, 650733622665, 10417925247240, 177191430300339, 3190747212651432, 60645032890871688, 1213255040678034508, 25484737348664027532, 560785511736390349080
Offset: 0

Views

Author

Seiichi Manyama, Feb 21 2024

Keywords

Crossrefs

Column k=2 of A177250.

Programs

  • Magma
    [n le 5 select 0 else (&+[(-1)^k*Factorial(n-2*k-4)/Factorial(k): k in [0..Floor((n-6)/3)]])/2: n in [0..30]]; // G. C. Greubel, May 01 2024
    
  • Mathematica
    Table[Sum[(-1)^k*(n-2*k-4)!/k!, {k,0,Floor[(n-6)/3]}]/2, {n,0,30}] (* G. C. Greubel, May 01 2024 *)
  • PARI
    my(N=30, x='x+O('x^N)); concat([0, 0, 0, 0, 0, 0], Vec(sum(k=2, N, k!*x^(k+4)/(1+x^3)^(k+1))/2))
    
  • PARI
    a(n, k=2, q=3) = sum(j=0, n\q-k, (-1)^j*(n-(q-1)*(j+k))!/j!)/k!;
    
  • SageMath
    [sum((-1)^k*factorial(n-2*k-4)/factorial(k) for k in range(1+(n-6)//3))/2 for n in range(31)] # G. C. Greubel, May 01 2024

Formula

G.f.: (1/2) * Sum_{k>=2} k! * x^(k+4) / (1+x^3)^(k+1).
a(n) = (1/2) * Sum_{k=0..floor(n/3)-2} (-1)^k * (n-2*k-4)! / k!.

A370530 Number of permutations of [n] having exactly three adjacent 3-cycles.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 20, 116, 820, 6600, 59650, 598140, 6592740, 79232140, 1031214100, 14450182880, 216911207555, 3472641749080, 59063810100120, 1063582404217144, 20215010963623896, 404418346892678160, 8494912449554675844, 186928503912130116360
Offset: 0

Views

Author

Seiichi Manyama, Feb 21 2024

Keywords

Crossrefs

Column k=3 of A177250.

Programs

  • Magma
    [n le 8 select 0 else (&+[(-1)^k*Factorial(n-2*k-6)/Factorial(k): k in [0..Floor((n-9)/3)]])/6: n in [0..30]]; // G. C. Greubel, May 01 2024
    
  • Mathematica
    Table[Sum[(-1)^k*(n-2*k-6)!/k!, {k,0,Floor[(n-9)/3]}]/6, {n,0,30}] (* G. C. Greubel, May 01 2024 *)
  • PARI
    my(N=30, x='x+O('x^N)); concat([0, 0, 0, 0, 0, 0, 0, 0, 0], Vec(sum(k=3, N, k!*x^(k+6)/(1+x^3)^(k+1))/6))
    
  • PARI
    a(n, k=3, q=3) = sum(j=0, n\q-k, (-1)^j*(n-(q-1)*(j+k))!/j!)/k!;
    
  • SageMath
    [sum((-1)^k*factorial(n-2*k-6)/factorial(k) for k in range(1+(n-9)//3))/6 for n in range(31)] # G. C. Greubel, May 01 2024

Formula

G.f.: (1/6) * Sum_{k>=3} k! * x^(k+6) / (1+x^3)^(k+1).
a(n) = (1/6) * Sum_{k=0..floor(n/3)-3} (-1)^k * (n-2*k-6)! / k!.

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.