OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..11
EXAMPLE
a(1) = 1001: (1,2,3,4,5,6,7), (1,2,3,4,5,7,6), ..., (4,3,5,2,1,7,6), (4,3,5,2,6,1,7).
MAPLE
b:= proc(x, y, z, u, v, w, h) option remember; local n, g;
n:= x+y+z+u+v+w+h; g:= x+2*y+3*z+4*u+5*v+6*w+7*h -8*(n-1)/2;
`if`(n<2, 1, `if`(x>0 and 1<=g, b(x-1, y, z, u, v, w, h), 0)+
`if`(y>0 and 2<=g, b(x, y-1, z, u, v, w, h), 0)+
`if`(z>0 and 3<=g, b(x, y, z-1, u, v, w, h), 0)+
`if`(u>0 and 4<=g, b(x, y, z, u-1, v, w, h), 0)+
`if`(v>0 and 5<=g, b(x, y, z, u, v-1, w, h), 0)+
`if`(w>0 and 6<=g, b(x, y, z, u, v, w-1, h), 0)+
`if`(h>0 and 7<=g, b(x, y, z, u, v, w, h-1), 0))
end:
a:= n-> b(n$7):
seq(a(n), n=0..4);
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Aug 16 2012
STATUS
approved