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.

A320129 Number of ways to group the first 2*n natural numbers into n pairs (xi, yi) such that the n numbers xi + yi are all different.

Original entry on oeis.org

1, 1, 2, 10, 55, 412, 3736, 40518, 505486, 7145031, 112844566, 1970286922, 37676184205
Offset: 0

Views

Author

Altug Alkan, Oct 06 2018

Keywords

Examples

			For n = 2, a(2) = 2 since {(1,3), (2,4)} and {(1,2), (3,4)} are corresponding sets. {(2,4), (1,3)} and {(3,1), (4,2)} are considered to be the same grouping with {(1,3), (2,4)}.
		

Crossrefs

Programs

  • PARI
    okperm(vp, n) = {for (k=1, n-1, if (vp[k] > vp[k+1], return (0)); ); for (k=1, n, if (vp[k+n] <= vp[k], return (0)); ); 1; }
    a(n) = if(n==0, 1, {nb = 0; nn = 2*n; for (j=0, nn!-1, vp = numtoperm(nn, j); if (okperm(vp, n), vs = vector(n, k, vp[k]+vp[k+n]); if (#vs == #Set(concat(vs)), nb++); ); ); nb; } ) \\ after Michel Marcus at A272363
    
  • Python
    from sympy.utilities.iterables import multiset_partitions
    def A320129(n):
        return 1 if n == 0 else sum(1 for p in multiset_partitions(list(range(1,2*n+1)),n) if max(len(d) for d in p) == 2 and len(set(sum(d) for d in p)) == n) # Chai Wah Wu, Oct 08 2018

Formula

a(n) >= A272363(n).

Extensions

a(11)-a(12) from Giovanni Resta, Oct 09 2018

A007631 Number of solutions to non-attacking reflecting queens problem.

Original entry on oeis.org

1, 1, 0, 0, 2, 4, 0, 2, 10, 32, 38, 140, 496, 1186, 3178, 16792, 82038, 289566, 1139874, 5914118, 33800010, 142337180, 721286448, 4384569864
Offset: 0

Views

Author

Keywords

Comments

a(n) is the number of ways to pair the natural numbers from 1 to n with those between n+1 and 2*n into n pairs (xi,yi) such that the 2*n numbers yi+i and yi-i are all different. - Michel Marcus, Apr 27 2016

Examples

			For n = 4, ((1,7), (2,5), (3,8), (4,6)) is an instance of such grouping. ((2,5), (1,7), (3,8), (4,6)) is considered to be the same grouping.
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • PARI
    a(n) = {nb = 0; for (j=0, n!-1, vp = numtoperm(n, j); vb = vector(n, k, vp[k]+n); vs = vector(n, k, vb[k]+k); vd = vector(n, k, vb[k]-k); if (#vs + #vd == #Set(concat(vs, vd)), nb++); ); nb; } \\ Michel Marcus,  Apr 27 2016

Extensions

a(18)-a(21) from Sean A. Irvine, Jan 13 2018
a(0)-a(3) prepended by Michel Marcus, Oct 03 2018
a(22) from Sean A. Irvine, Oct 04 2018
a(23) from Sean A. Irvine, Oct 07 2018

A320168 Number of ways to group the first 2*n positive integers into n pairs (xi, yi) with xi < yi, and such that the n numbers (yi mod xi) are all different.

Original entry on oeis.org

1, 1, 2, 2, 7, 12, 22, 26, 85, 226, 717, 1695, 5071, 14275, 47405, 176747, 638329, 2166516
Offset: 0

Views

Author

Altug Alkan, Oct 07 2018

Keywords

Comments

How does a(n+1)/a(n) behave as n increases?

Examples

			a(3) = 2 because {(1,3), (2,5), (4,6)} and {(1,5), (2,3), (4,6)} are corresponding sets.
a(4) = 7 because {(1,6), (2,5), (3,8), (4,7)}, {(1,3), (2,7), (4,6), (5,8)}, {(1,7), (2,3), (4,6), (5,8)}, {(1,3), (2,5), (4,7), (6,8)}, {(1,5), (2,3), (4,7), (6,8)}, {(1,2), (3,7), (4,6), (5,8)}, {(1,2), (3,8), (4,7), (5,6)} are corresponding sets.
		

Crossrefs

Extensions

a(13)-a(17) from Rémy Sigrist, Oct 07 2018
Showing 1-3 of 3 results.