|
|
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.
|
|
4
|
|
|
1, 1, 0, 2, 12, 64, 220, 1886, 16346, 142420, 1302106, 14467384, 177079358
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
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.
|
|
PROG
|
(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
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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|