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 13 results. Next

A177249 Number of permutations of [n] having no adjacent transpositions, that is, no cycles of the form (i, i+1).

Original entry on oeis.org

1, 1, 1, 4, 19, 99, 611, 4376, 35621, 324965, 3285269, 36462924, 440840359, 5767387591, 81184266631, 1223531387056, 19657686459529, 335404201199049, 6056933308042409, 115417137054004820, 2314399674388138811, 48717810299204919851, 1074106226256896375531
Offset: 0

Views

Author

Emeric Deutsch, May 07 2010

Keywords

Examples

			a(3)=4 because we have (1)(2)(3), (13)(2), (123), and (132).
		

Crossrefs

Programs

  • Magma
    [(&+[(-1)^j*Factorial(n-j)/Factorial(j): j in [0..Floor(n/2)]]): n in [0..30]]; // G. C. Greubel, Apr 28 2024
    
  • Maple
    a := proc (n) options operator, arrow: sum((-1)^j*factorial(n-j)/factorial(j), j = 0 .. floor((1/2)*n)) end proc: seq(a(n), n = 0 .. 22);
  • Mathematica
    a[n_] := Sum[(-1)^j*(n - j)!/j!, {j, 0, n/2}];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Nov 20 2017 *)
  • SageMath
    [sum((-1)^j*factorial(n-j)/factorial(j) for j in range(1+n//2)) for n in range(31)] # G. C. Greubel, Apr 28 2024

Formula

a(n) = A177248(n,0).
Limit_{n->oo} a(n)/n! = 1.
a(n) = Sum_{j=0..floor(n/2)} (-1)^j*(n-j)!/j!.
a(n) - n*a(n-1) = a(n-2) if n is odd.
a(n) - n*a(n-1) = a(n-2) + 2*(-1)^(n/2) if n is even.
The o.g.f. g(z) satisfies z^2*(1+z^2)*g'(z)-(1+z^2)(1-z-z^2)g(z)+1-z^2=0; g(0)=1.
The e.g.f. G(z) satisfies (1-z)G"(z)-2G'(z)-G(z)=-2cos(z); G(0)=1, G'(0)=1.
The o.g.f. is hypergeometric2F0([1,1], [], x/(1+x^2))/(1+x^2). - Mark van Hoeij, Nov 08 2011
G.f.: 1/Q(0), where Q(k)= 1 + x^2 - x*(k+1)/(1-x*(k+1)/Q(k+1)); (continued fraction). - Sergei N. Gladkovskii, Apr 20 2013
D-finite with recurrence a(n) = n*a(n-1) + (n-2)*a(n-3) + a(n-4). - R. J. Mathar, Jul 26 2022
G.f.: Sum_{k>=0} k! * x^k / (1+x^2)^(k+1). - Seiichi Manyama, Feb 20 2024

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

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

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

Original entry on oeis.org

1, 1, 2, 6, 23, 1, 118, 2, 714, 6, 5016, 24, 40201, 118, 1, 362163, 714, 3, 3623772, 5016, 12, 39876540, 40200, 60, 478639079, 362163, 357, 1, 6223394516, 3623772, 2508, 4, 87138394540, 39876540, 20100, 20, 1307195547720, 478639080, 181080, 120
Offset: 0

Views

Author

Emeric Deutsch, May 07 2010

Keywords

Comments

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

Examples

			T(9,2)=3 because we have (1234)(5678)(9), (1234)(5)(6789), and (1)(2345)(6789).
Triangle starts:
     1;
     1;
     2;
     6;
    23,  1;
   118,  2;
   714,  6;
  5016, 24;
		

Crossrefs

Columns k=0-3 give A177253, A369098, A370652, A370653.
Cf. A000142 (row sums).

Programs

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

Formula

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

A177253 Number of permutations of [n] having no adjacent 4-cycles, i.e., no cycles of the form (i, i+1, i+2, i+3).

Original entry on oeis.org

1, 1, 2, 6, 23, 118, 714, 5016, 40201, 362163, 3623772, 39876540, 478639079, 6223394516, 87138394540, 1307195547720, 20916564680761, 355600269756485, 6401066270800350, 121624180731849810, 2432546364331038479, 51084540451761077514, 1123879093137556106358
Offset: 0

Views

Author

Emeric Deutsch, May 07 2010

Keywords

Examples

			a(5)=118 because the only permutations of {1,2,3,4,5} having adjacent 4-cycles are (1234)(5) and (1)(2345).
		

Crossrefs

Programs

  • Magma
    [(&+[(-1)^j*Factorial(n-3*j)/Factorial(j): j in [0..Floor(n/4)]]): n in [0..30]]; // G. C. Greubel, May 11 2024
    
  • Maple
    a := proc (n) options operator, arrow: sum((-1)^j*factorial(n-3*j)/factorial(j), j = 0 .. floor((1/4)*n)) end proc: seq(a(n), n = 0 .. 22);
  • Mathematica
    a[n_] := Sum[(-1)^j*(n - 3*j)!/j!, {j, 0, n/4}];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Nov 20 2017 *)
  • SageMath
    [sum((-1)^j*factorial(n-3*j)/factorial(j) for j in range(1+n//4)) for n in range(31)] # G. C. Greubel, May 11 2024

Formula

a(n) = Sum_{j=0..floor(n/4)} (-1)^j*(n-3*j)!/j!.
a(n) - n*a(n-1) = 3*a(n-4) + 4*(-1)^{n/4} if 4|n otherwise a(n) - n*a(n-1) = 3*a(n-4).
a(n) = A177252(n,0).
limit_{n->oo} a(n)/n! = 1.
The o.g.f. g(z) satisfies z^2*(1+z^4)*g'(z) - (1+z^4)(1-z-3z^4)g(z) + 1 - 3z^4 = 0; g(0)=1.
D-finite with recurrence a(n) = n*a(n-1) + 2*a(n-4) + (n-4)*a(n-5) + 3*a(n-8). - R. J. Mathar, Jul 26 2022
G.f.: Sum_{k>=0} k! * x^k / (1+x^4)^(k+1). - Seiichi Manyama, Feb 20 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!.

A358493 a(n) = Sum_{k=0..floor(n/3)} (n-2*k)!/k!.

Original entry on oeis.org

1, 1, 2, 7, 26, 126, 745, 5163, 41052, 367981, 3669484, 40282220, 482650681, 6267119885, 87659113950, 1313921407891, 21010208286486, 356998222642362, 6423340164746737, 122001442713615031, 2439314857827015896, 51212765334037840345, 1126436834463405257528
Offset: 0

Views

Author

Seiichi Manyama, Nov 19 2022

Keywords

Crossrefs

Programs

  • Magma
    [(&+[Factorial(n-2*k)/Factorial(k): k in [0..Floor(n/3)]]): n in [0..30]]; // G. C. Greubel, May 01 2024
    
  • Mathematica
    Table[Sum[(n-2*k)!/k!, {k,0,Floor[n/3]}], {n,0,30}] (* G. C. Greubel, May 01 2024 *)
  • PARI
    a(n) = sum(k=0, n\3, (n-2*k)!/k!);
    
  • SageMath
    [sum(factorial(n-2*k)/factorial(k) for k in range(1+n//3)) for n in range(31)] # G. C. Greubel, May 01 2024

Formula

a(n) = (n-1) * a(n-1) + (n-2) * a(n-2) + (n-4) * a(n-3) - 2 * a(n-4) - 2 * a(n-5) + 3 for n > 4.
a(n) ~ n! * (1 + 1/n^2 + 1/n^3 + 3/(2*n^4) + 4/n^5 + 41/(3*n^6) + 97/(2*n^7) + 1399/(8*n^8) + 3961/(6*n^9) + 322951/(120*n^10) + ...). - Vaclav Kotesovec, Nov 24 2022
G.f.: Sum_{k>=0} k! * x^k/(1-x^3)^(k+1). - Seiichi Manyama, Feb 26 2024

A370525 Number of permutations of [n] having exactly one adjacent 3-cycle.

Original entry on oeis.org

0, 0, 0, 1, 2, 6, 22, 114, 696, 4923, 39612, 357900, 3588836, 39556420, 475392840, 6187284605, 86701097310, 1301467245330, 20835850494474, 354382860600678, 6381494425302864, 121290065781743383, 2426510081356069016, 50969474697328055064, 1121571023472780698152
Offset: 0

Views

Author

Seiichi Manyama, Feb 21 2024

Keywords

Crossrefs

Column k=3 of A370527.
Column k=1 of A177250.

Programs

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

Formula

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

A370324 Number of derangements of [n] having no adjacent 2-cycles, no adjacent 3-cycles, no adjacent 4-cycles and no adjacent 5-cycles.

Original entry on oeis.org

1, 0, 0, 1, 6, 34, 217, 1567, 12842, 117704, 1193802, 13280778, 160843345, 2107036346, 29689965966, 447822830067, 7199604972876, 122907451783308, 2220526880775841, 42328779624824103, 849065324387063412, 17877539166289948864, 394246737752465047380
Offset: 0

Views

Author

Seiichi Manyama, Feb 22 2024

Keywords

Crossrefs

Programs

  • PARI
    my(N=30, x='x+O('x^N)); Vec(sum(k=0, N, k!*x^k*((1-x)/(1-x^6))^(k+1)))

Formula

G.f.: Sum_{k>=0} k! * x^k * ( (1-x)/(1-x^6) )^(k+1).
a(n) = Sum_{i, j, k, l, m>=0 and i+2*j+3*k+4*l+5*m<=n} (-1)^(i+j+k+l+m) * (n-j-2*k-3*l-4*m)!/(i!*j!*k!*l!*m!).
Showing 1-10 of 13 results. Next