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

A176127 The number of permutations of {1,2,...,n,1,2,...,n} with the property that there are k numbers between the two k's in the set for k=1,...,n.

Original entry on oeis.org

0, 0, 2, 2, 0, 0, 52, 300, 0, 0, 35584, 216288, 0, 0, 79619280, 653443600, 0, 0, 513629782560, 5272675722400, 0, 0, 7598911885030976, 93690316113031872, 0, 0, 223367222197529806464, 3214766521218764786304, 0, 0
Offset: 1

Views

Author

Andrew McFarland, Apr 09 2010

Keywords

Examples

			a(1)=0; a(2)=0; a(3)=a(4)=2 since {{2,3,1,2,1,3},{3,1,2,1,3,2}} and {{4,1,3,1,2,4,3,2},{2,3,4,2,1,3,1,4}} are the only ways to permute {1,2,3,1,2,3} and {1,2,3,4,1,2,3,4}, respectively, such that there is one number between the 1's, two numbers between the 2's,..., n numbers between the n's.
		

References

Crossrefs

Programs

  • Sage
    a=lambda n:sum(1 for i in DLXCPP([(i-1,j+n,i+j+n+1)for i in[1..n]for j in[0..n+n-i-2]]+[(i,)for i in[n..n+n-1]]))if n%4 in[0,3] else 0
    # Tomas Boothby, Jun 14 2013

Formula

a(n) = 2 * A014552(n).

Extensions

Edited and more terms added from A014552 by Max Alekseyev, May 31 2011, May 19 2015
Corrected and extended using results from the Assarpour et al. (2015) paper by N. J. A. Sloane, Feb 22 2016 at the suggestion of William Rex Marshall.

A203435 Number of partitions of {1,2,...,4n} into n 4-element subsets having the same sum.

Original entry on oeis.org

1, 1, 4, 32, 392, 6883, 171088, 5661874, 242038179, 13147317481
Offset: 0

Views

Author

Alois P. Heinz, Jan 01 2012

Keywords

Comments

The element sum of each subset is 8n+2. The larger terms were computed with Knuth's dancing links algorithm.

Examples

			a(1) = 1: {1,2,3,4}.
a(2) = 4: {1,2,7,8}, {3,4,5,6}; {1,3,6,8}, {2,4,5,7}; {1,4,5,8}, {2,3,6,7}; {1,4,6,7}, {2,3,5,8}.
		

Crossrefs

Column k=4 of A203986.

Programs

  • Maple
    b:= proc() option remember; local i, j, t, m; m:= args[nargs]; if args[1]=0 then `if`(nargs=2, 1, b(args[t] $t=2..nargs)) elif args[1]<1 then 0 else add(`if`(args[j] `if`(n=0, 1, b(((8*n+2)+4/97) $n, 4*n)/n!): seq(a(n), n=0..6);
  • Mathematica
    b[l_] := b[l] = Module[{nl = Length[l], k = l[[-1]], m = l[[-2]]}, Which[l[[1]] == 0, If[nl == 3, 1, b[l[[2 ;; nl]]]], l[[1]] < 1, 0, True, Sum[If[l[[j]] < m, 0, b[Join[Sort[Table[l[[i]] - If[i == j, m + 1/97, 0], {i, 1, nl - 2}]], {m - 1, k}]]], {j, 1, nl - 2}]]];
    a[n_] := If[n == 0, 1, b[Join[Array[8*n + 2 + 4/97& , n], {4*n, 4}]]/n!];
    Table[a[n], {n, 0, 6}] (* Jean-François Alcover, Jun 03 2018, adapted from Maple *)

A321956 Number of permutations of 3 indistinguishable copies of 1,...,n such that the first and second copies of j are adjacent and there are exactly j-1 numbers between the second and the third copy of j.

Original entry on oeis.org

1, 1, 0, 2, 4, 0, 16, 40, 0, 456, 1759, 0, 34636, 175198, 0, 5494621, 34043062, 0
Offset: 0

Views

Author

Alois P. Heinz, Nov 22 2018

Keywords

Examples

			a(3) = 2: 111332232, 332232111.
a(4) = 4: 111334432242, 332232441114, 334432242111, 441114332232.
		

Crossrefs

Formula

a(n) = 0 for n == 2 (mod 3).
Showing 1-3 of 3 results.