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

A137729 Number of circular permutations of the multiset {1,1,2,2,...,n,n} (up to rotations).

Original entry on oeis.org

1, 1, 2, 16, 318, 11352, 623760, 48648960, 5108105520, 694702028160, 118794043549440, 24946749109094400, 6311527524161798400, 1893458257242791500800, 664603848292138865510400, 269829162406607158901145600
Offset: 0

Views

Author

Max Alekseyev, Feb 09 2008

Keywords

Crossrefs

Row n=2 of A208183.

Formula

a(n) = ((2*n)!/2^n + n!) / (2*n).

Extensions

a(0)=1 prepended by Alois P. Heinz, Jul 28 2015

A137730 Number of circular permutations of the multiset {1,1,2,2,...,n,n} (up to rotations) with odd distances between equal elements.

Original entry on oeis.org

1, 1, 7, 72, 1452, 43200, 1814760, 101606400, 7315680960, 658409472000, 72425043734400, 9560105533440000, 1491376463456140800, 271430516305428480000, 57000408424183569945600, 13680098021793595392000000, 3720986661927868408018944000, 1138621918549924531666944000000
Offset: 1

Views

Author

Max Alekseyev, Feb 09 2008

Keywords

Crossrefs

Programs

  • Mathematica
    a[1]=1;a[n_]:=Sum[Abs[(n-1)!-n!*StirlingS1[n-1,j]],{j,0,n-1}]/2;Flatten[Table[a[n],{n,1,18}]] (* Detlef Meya, Apr 10 2024 *)

Formula

For even n, a(n) = n!^2 / (2n). For odd n, a(n) = (n!^2 + n!) / (2n).
a(1) = 1; For n > 1: a(n) = Sum_{j=0..n-1} (abs((n - 1)! - n!*Stirling1(n - 1, j)))/2. - Detlef Meya, Apr 10 2024

A137737 Number of circular permutations of the multiset {1,1,2,2,...,n,n} (up to rotations) with even distances between equal elements.

Original entry on oeis.org

0, 1, 0, 30, 0, 13560, 0, 27785520, 0, 162030637440, 0, 2156625389318400, 0, 56857271240920550400, 0, 2686506065987036477184000, 0, 211180868835057744408834048000, 0, 26072812428113877344085395644416000, 0
Offset: 1

Views

Author

Max Alekseyev, Feb 09 2008

Keywords

Crossrefs

Formula

For odd n, a(n) = 0. For even n, a(n) = (n!^3 / (n/2)!^2 / 2^n + n!) / (2n).
a(2n) = A137749(n)

A114939 Number of essentially different seating arrangements for n couples around a circular table with 2n seats avoiding spouses being neighbors and avoiding clusters of 3 persons with equal gender.

Original entry on oeis.org

0, 1, 7, 216, 10956, 803400, 83003040, 11579823360, 2080493573760, 469031859192960, 129727461014726400, 43176116371928601600, 17025803126147196057600, 7850538273249476117913600
Offset: 1

Views

Author

Hugo Pfoertner, Jan 08 2006

Keywords

Comments

Arrangements that differ only by rotation or reflection are excluded by the following conditions: Seat number 1 is assigned to person (a). Person (a)'s spouse (A) can only take seats with numbers <=(n+1). If (A) gets seat n+1 (i.e. sits exactly opposite to her/his spouse) then person (B) can only take seats with numbers <= n.

Examples

			a(2)=1 because the only valid arrangement is aBAb.
a(3)=7 because the only valid arrangements under the given conditions are: abAcBC, aBAcbC, aBcAbC, aBcACb, acAbCB, acBAbC, aCAbcB.
		

Crossrefs

Programs

  • Mathematica
    a[1] = 0;
    a[n_] := (n-1)!/4 Sum[(-1)^j(n-j)! SeriesCoefficient[ SeriesCoefficient[Tr[ MatrixPower[{{0, 1, 0, y^2, 0, 0}, {z y^2, 0, 1, 0, y^2, 0}, {z y^2, 0, 0, 0, y^2, 0}, {0, 1, 0, 0, 0, z}, {0, 1, 0, y^2, 0, z}, {0, 0, 1, 0, y^2, 0}}, 2n]], {y, 0, 2n}] , {z, 0, j}], {j, 0, n}];
    Array[a, 14] (* Jean-François Alcover, Dec 03 2018, from PARI *)
  • PARI
    { a(n) = if(n<=1, 0, (-1)^n*(n-1)!*2^(n-1) + n! * polcoeff( polcoeff( [0, 2*y*z^3 + z^2, -3*y*z^5 - 4*z^4 + ((-2*y^2 - 1)/y)*z^3, 6*y*z^7 + (4*y^2 + 11)*z^6 + ((8*y^2 + 4)/y)*z^5 + 3*z^4] * sum(j=0,n-1, j! * [0, 0, 0, -z^6 + z^4; 1, 0, 0, ((y^2 + 1)/y)*z^5 - 2*z^4 + ((-y^2 - 1)/y)*z^3; 0, 1, 0, ((2*y^2 + 2)/y)*z^3 + z^2; 0, 0, 1, -2*z^2]^(n+j) ) * [1,0,0,0]~, 2*n,z), 0,y) / 2 ); }

Formula

See Alekseyev (2016) and the PARI code for the formula.
a(n) = A258338(n) / (4*n).

Extensions

a(4)-a(7) corrected, formula and further term provided by Max Alekseyev, Feb 15 2008

A258338 Ternary ménage problem: number of seating arrangements for n opposite-sex couples around a circular table such that no spouses and no triples of the same sex seat next to each other. Seats are labeled.

Original entry on oeis.org

0, 8, 84, 3456, 219120, 19281600, 2324085120, 370554347520, 74897768655360, 18761274367718400, 5708008284647961600, 2072453585852572876800, 885341762559654194995200, 439630143301970662603161600, 251099117378080818090596352000, 163464570058143774978660630528000
Offset: 1

Views

Author

Max Alekseyev, May 27 2015

Keywords

Comments

Conjecture: (a(n)/n!^2)^(1/n) ~ (3+sqrt(5))/2. - Vaclav Kotesovec, May 29 2015

Crossrefs

Cf. A114939 (counts up to rotations and reflections)

Programs

  • Mathematica
    a[1] = 0;
    a[n_] := n! Sum[(-1)^j (n-j)! SeriesCoefficient[ SeriesCoefficient[ Tr[ MatrixPower[{{0, 1, 0, y^2, 0, 0}, {z y^2, 0, 1, 0, y^2, 0}, {z y^2, 0, 0, 0, y^2, 0}, {0, 1, 0, 0, 0, z}, {0, 1, 0, y^2, 0, z}, {0, 0, 1, 0, y^2, 0}}, 2n]], {y, 0, 2n}], {z, 0, j}], {j, 0, n}];
    Array[a, 16] (* Jean-François Alcover, Dec 03 2018, from 1st PARI program *)
  • PARI
    { a(n) = if(n<2, 0, n! * sum(j=0,n, (-1)^j * (n-j)! *polcoeff( polcoeff( trace([0, 1, 0, y^2, 0, 0; z*y^2, 0, 1, 0, y^2, 0; z*y^2, 0, 0, 0, y^2, 0; 0, 1, 0, 0, 0, z; 0, 1, 0, y^2, 0, z; 0, 0, 1, 0, y^2, 0]^(2*n)), 2*n,y) ,j,z)) ); }
    
  • PARI
    { a(n) = if(n<2, 0, n! *  polcoeff( serlaplace( polcoeff( trace([-y, z*y, z, 0, z*y, -y; -y, (z - 1)*y, 0, (z - 1)*y^2, z*y, -y; 0, (z - 1)*y, 0, (z - 1)*y^2, 0, -y; -y, 0, z - 1, 0, (z - 1)*y, 0; -y, z*y, z - 1, 0, (z - 1)*y, -y; -y, z*y, 0, z*y^2, z*y, -y]^n), n, y) )/(1-z) + O(z^(n+1)), n, z) ) }

Formula

a(n) = A114939(n) * 4 * n.

A275801 Number of alternating permutations of the multiset {1,1,2,2,...,n,n}.

Original entry on oeis.org

1, 0, 1, 4, 53, 936, 25325, 933980, 45504649, 2824517520, 217690037497, 20394614883316, 2282650939846781, 300814135522967736, 46103574973075123877, 8130996533576437261772, 1635028654501420083152785, 371853339350614571322913824, 94969025880924845123887493233
Offset: 0

Views

Author

Max Alekseyev, Aug 09 2016

Keywords

Comments

Number of permutations (p(1),...,p(2n)) of {1,1,2,2,...,n,n} satisfying p(1) < p(2) > p(3) < ... < p(2n).
a(n) <= A005799(n) <= A275829(n).

Crossrefs

A275829 Number of weakly alternating permutations of the multiset {1,1,2,2,...,n,n}.

Original entry on oeis.org

1, 1, 2, 12, 140, 2564, 68728, 2539632, 123686800, 7677924688, 591741636128, 55438330474944, 6204888219697856, 817697605612952384, 125322509904814743424, 22102340129003429880576, 4444468680409243484516608, 1010802175212828388101900544, 258152577318424951261637001728
Offset: 0

Views

Author

Max Alekseyev, Aug 11 2016

Keywords

Comments

Number of permutations (p(1),...,p(2n)) of {1,1,2,2,...,n,n} satisfying p(1) <= p(2) >= p(3) <= p(4) >= p(5) <= ... <= p(2n).
a(n) >= A005799(n) >= A275801(n).

Crossrefs

Showing 1-7 of 7 results.