OFFSET
0,4
COMMENTS
The first lists of distinct parts in the order given by A246688 are: 0:[], 1:[1], 2:[2], 3:[1,2], 4:[3], 5:[1,3], 6:[4], 7:[1,4], 8:[2,3], 9:[5], 10:[1,2,3], 11:[1,5], 12:[2,4], 13:[6], 14:[1,2,4], 15:[1,6], 16:[2,5], 17:[3,4], 18:[7], 19:[1,2,5], 20:[1,3,4], ... .
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1260
FORMULA
a(n) = A246690(n,n).
EXAMPLE
a(7) = 5 because there are 5 compositions of 7 into parts 1, 4: [1,1,1,1,1,1,1], [1,1,1,4], [1,1,4,1], [1,4,1,1], [4,1,1,1].
MAPLE
b:= proc(n, i) b(n, i):= `if`(n=0, [[]], `if`(i>n, [],
[map(x->[i, x[]], b(n-i, i+1))[], b(n, i+1)[]]))
end:
f:= proc() local i, l; i, l:=0, [];
proc(n) while n>=nops(l)
do l:=[l[], b(i, 1)[]]; i:=i+1 od; l[n+1]
end
end():
g:= proc(n, l) option remember; `if`(n=0, 1,
add(`if`(i>n, 0, g(n-i, l)), i=l))
end:
a:= n-> g(n, f(n)):
seq(a(n), n=0..80);
MATHEMATICA
b[n_, i_] := b[n, i] = If[n == 0, {{}}, If[i > n, {}, Join[Prepend[#, i]& /@ b[n - i, i + 1], b[n, i + 1]]]];
f = Module[{i = 0, l = {}}, Function[n, While[n >= Length[l], l = Join[l, b[i, 1]]; i++]; l[[n + 1]]]];
g[n_, l_] := g[n, l] = If[n == 0, 1, Sum[If[i>n, 0, g[n - i, l]], {i, l}]];
a[n_] := g[n, f[n]];
Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Jul 12 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Alois P. Heinz, Sep 01 2014
STATUS
approved