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.

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

Original entry on oeis.org

1, 1, 0, 2, 12, 64, 220, 1886, 16346, 142420, 1302106, 14467384, 177079358
Offset: 0

Views

Author

Michel Marcus, Apr 27 2016

Keywords

Examples

			For n=3, ((1,5), (2,3), (4,6)) is an instance of such grouping. ((2,3), (1,5), (4,6)) is considered to be the same grouping. The other one is ((1,3), (2,6), (4,5)). So a(3) = 2.
		

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) = {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]); vd = vector(n, k, vp[k]-vp[k+n]); if (#vs + #vd == #Set(concat(vs, vd)), nb++););); nb;}
    
  • Python
    from sympy.utilities.iterables import multiset_partitions
    def A272363(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]))+len(set([abs(d[0]-d[1]) for d in p])) == 2*n) # Chai Wah Wu, Oct 08 2018

Formula

a(n) >= A002968(n). - Altug Alkan, Oct 05 2018
a(n) <= A060963(n). - Chai Wah Wu, Oct 08 2018

Extensions

a(0), a(7)-a(10) from Alois P. Heinz, Oct 05 2018
a(11)-a(12) from Giovanni Resta, Oct 11 2018