A364907 Number of ways to write n as a nonnegative linear combination of an integer partition of n.
1, 1, 4, 13, 50, 179, 696, 2619, 10119, 38867, 150407, 582065, 2260367, 8786919, 34225256, 133471650, 521216494, 2037608462, 7974105052, 31235316275, 122457794193, 480473181271, 1886555402750, 7412471695859, 29142658077266, 114643347181003, 451237737215201
Offset: 0
Keywords
Examples
The a(0) = 1 through a(3) = 13 ways: 0 1*1 1*2 1*3 0*1+2*1 0*2+3*1 1*1+1*1 1*2+1*1 2*1+0*1 0*1+0*1+3*1 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, i, m) option remember; `if`(n=0, `if`(m=0, 1, 0), `if`(i<1, 0, b(n, i-1, m)+add(b(n-i, min(i, n-i), m-i*j), j=0..m/i))) end: a:= n-> b(n$3): seq(a(n), n=0..27); # 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,IntegerPartitions[n]}]],{n,0,5}]
Extensions
a(9)-a(26) from Alois P. Heinz, Jan 28 2024
Comments