A364908 Number of ways to write n as a nonnegative linear combination of an integer composition of n.
1, 1, 4, 15, 70, 314, 1542, 7428, 36860, 182911, 917188, 4612480, 23323662, 118273428, 601762636, 3069070533, 15689123386, 80356953555, 412300910566, 2118715503962, 10902791722490, 56175374185014, 289766946825180, 1496239506613985, 7733302967423382
Offset: 0
Keywords
Examples
The a(3) = 15 ways to write 3 as a nonnegative linear combination of an integer composition of 3: 1*3 0*2+3*1 1*1+1*2 0*1+0*1+3*1 1*2+1*1 3*1+0*2 0*1+1*1+2*1 0*1+2*1+1*1 0*1+3*1+0*1 1*1+0*1+2*1 1*1+1*1+1*1 1*1+2*1+0*1 2*1+0*1+1*1 2*1+1*1+0*1 3*1+0*1+0*1
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..500
Crossrefs
Programs
-
Maple
b:= proc(n, m) option remember; `if`(n=0, `if`(m=0, 1, 0), add(add(b(n-i, m-i*j), j=0..m/i), i=1..n)) end: a:= n-> b(n$2): seq(a(n), n=0..25); # Alois P. Heinz, Jan 28 2024
-
Mathematica
combs[n_,y_]:=With[{s=Table[{k,i},{k,y},{i,0,Floor[n/k]}]}, Select[Tuples[s],Total[Times@@@#]==n&]]; Table[Length[Join@@Table[combs[n,ptn],{ptn,Join@@Permutations /@ IntegerPartitions[n]}]],{n,0,5}]
Extensions
a(8)-a(24) from Alois P. Heinz, Jan 28 2024
Comments