OFFSET
0,4
COMMENTS
Note: the counts given here are inclusive, e.g. A(n,6) includes the counts A(n,3) and A(n,2) which in turn both include A(n,1).
LINKS
FORMULA
A(0, k) = 1. A(n, k) = Sum_{r=1..n where r/gcd(r, k) divides n} Sum_{c as each composition of n/(r/gcd(r, k)) into gcd(r, k) parts} Product_{i as each composant of c} A(i-1, lcm(r, k))
MAPLE
with(combinat, composition); # composition(n, k) gives ordered partitions of integer n into k parts.
A079216bi := proc(n, k) option remember; local r; if(0 = n) then RETURN(1); else RETURN(add(PFixedByA057511(n, k, r), r=1..n)); fi; end;
PFixedByA057511 := proc(n, k, r) option remember; local ncycles, cyclen, i, c; ncycles := igcd(r, k); cyclen := r/ncycles; if(0 <> (n mod cyclen)) then RETURN(0); else add(mul(A079216bi(i-1, ilcm(r, k)), i=c), c=composition(n/cyclen, ncycles)); fi; end;
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen Jan 03 2002
STATUS
approved