login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A246691 Number of compositions of n into parts of the n-th list of distinct parts in the order given by A246688. 3

%I #21 Jul 12 2021 13:46:42

%S 1,1,1,3,0,4,0,5,4,0,274,11,13,0,1601,21,11,10,0,15571,7921,53,41,12,

%T 1,246441,64208,119,16169,47,89,35,0,1439975216,17319590,1835123,

%U 956698,531,274291,0,82,0,0,428262742476,1923714115,72992449,20086406,1915,4051405

%N Number of compositions of n into parts of the n-th list of distinct parts in the order given by A246688.

%C 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], ... .

%H Alois P. Heinz, <a href="/A246691/b246691.txt">Table of n, a(n) for n = 0..1260</a>

%F a(n) = A246690(n,n).

%e 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].

%p b:= proc(n, i) b(n, i):= `if`(n=0, [[]], `if`(i>n, [],

%p [map(x->[i, x[]], b(n-i, i+1))[], b(n, i+1)[]]))

%p end:

%p f:= proc() local i, l; i, l:=0, [];

%p proc(n) while n>=nops(l)

%p do l:=[l[], b(i, 1)[]]; i:=i+1 od; l[n+1]

%p end

%p end():

%p g:= proc(n, l) option remember; `if`(n=0, 1,

%p add(`if`(i>n, 0, g(n-i, l)), i=l))

%p end:

%p a:= n-> g(n, f(n)):

%p seq(a(n), n=0..80);

%t b[n_, i_] := b[n, i] = If[n == 0, {{}}, If[i > n, {}, Join[Prepend[#, i]& /@ b[n - i, i + 1], b[n, i + 1]]]];

%t f = Module[{i = 0, l = {}}, Function[n, While[n >= Length[l], l = Join[l, b[i, 1]]; i++]; l[[n + 1]]]];

%t g[n_, l_] := g[n, l] = If[n == 0, 1, Sum[If[i>n, 0, g[n - i, l]], {i, l}]];

%t a[n_] := g[n, f[n]];

%t Table[a[n], {n, 0, 80}] (* _Jean-François Alcover_, Jul 12 2021, after _Alois P. Heinz_ *)

%Y Cf. A246688, A246690, A246721 (the same for partitions).

%K nonn,look

%O 0,4

%A _Alois P. Heinz_, Sep 01 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 13:11 EDT 2024. Contains 371913 sequences. (Running on oeis4.)