OFFSET
1,3
COMMENTS
k = 9, 10, 14, 15, 19, ... A047208(n+3) for n = 1, 2, 3, 4, 5, ... .
LINKS
Wikipedia, Partition of a set
EXAMPLE
a(1) = 1: 18|27|36|45|9 with k = 9.
a(2) = 1: 1(10)|29|38|47|56 with k = 10.
MAPLE
b:= proc() option remember; local i, j, t; `if`(args[1]=0,
`if`(nargs=2, 1, b(args[t] $t=2..nargs)), add(
`if`(args[j] -args[nargs]<0, 0, b(sort([seq(args[i]-
`if`(i=j, args[nargs], 0), i=1..nargs-1)])[],
args[nargs]-1)), j=1..nargs-1))
end:
a:= proc(n) option remember; (k-> (m->
b((m/5)$5, k)/5!)(k*(k+1)/2))(5+5*n/2+3/4*(1-(-1)^n))
end:
seq(a(n), n=1..8);
MATHEMATICA
b[args_List] := b[args] = Module[{nargs = Length[args]}, If[args[[1]] == 0, If[nargs == 3, 1, b[args // Rest]], Sum[If[args[[j]] - Last[args] < 0, 0, b[Append[Sort[Flatten[Table[args[[i]] - If[i == j, Last[args], 0], {i, 1, nargs - 1}]]], Last[args] - 1]]], {j, 1, nargs - 1}]]];
a[n_] := a[n] = Function[k, Function[m, b[Append[Table[m/5, {5}], k]]/5!][k (k + 1)/2]][5 + 5n/2 + (3/4)(1 - (-1)^n)];
Table[Print[n, " ", a[n]]; a[n], {n, 1, 12}] (* Jean-François Alcover, Dec 16 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Aug 07 2018
STATUS
approved