ncomp[n_, a_, b_] := If[a≤n≤b, 1 + Underoverscript[∑, i = Max[1, n - b], arg3] ncomp[i, a, b], Underoverscript[∑, i = Max[1, n - b], arg3] ncomp[i, a, b]]

ncompk[n_, k_, a_, b_] := If[k == 1, If[a≤n≤b, 1, 0], Underoverscript[∑, i = Max[1, n - b], arg3] ncompk[i, k - 1, a, b]]

npart[n_, a_, b_] := If[a≤n≤b, 1 + Underoverscript[∑, i = Max[1, n - b], arg3] npart[i, n - i, b], Underoverscript[∑, i = Max[1, n - b], arg3] npart[i, n - i, b]]

npartk[n_, k_, a_, b_] := If[k == 1, If[a≤n≤b, 1, 0], Underoverscript[∑, i = Max[1, n - b], arg3] npartk[i, k - 1, n - i, b]]

abinputs = {{2, 3}, {3, 4}, {4, 5}, {2, 4}, {2, 5}, {4, 5}, {4, 6}, {4, 7}, {4, 8}, {4, 9}, {4, 10}, {4, 11}, {4, 12}} ;

TableForm[Table[sol = ncomp[n, abinputs[[col, 1]], abinputs[[col, 2]]] ; If[sol>0, sol, ""], {n, 1, 25}, {col, 1, Length[abinputs]}]]

1 1 1
1 1 1 1
1 1 1 2 2 1 1 1 1 1 1 1 1
2 1 2 3 1 1 1 1 1 1 1 1
2 1 4 4 1 1 1 1 1 1 1
3 2 5 7 1 1 1 1 1 1
4 1 1 8 10 1 1 1 2 2 2 2 2
5 1 2 11 16 2 2 2 2 3 3 3 3
7 3 1 17 24 1 3 3 3 3 4 4 4
9 3 24 37 2 4 4 4 4 5 5
12 2 1 36 57 1 2 4 6 6 6 6 7
16 4 3 52 87 3 3 5 7 9 9 9 9
21 6 3 77 134 3 6 7 9 11 13 13 13
28 5 1 112 205 1 7 10 12 14 16 18 18
37 6 1 165 315 1 7 13 17 19 21 23 25
49 10 4 241 483 4 7 16 22 27 29 31 33
65 11 6 354 741 6 11 20 29 36 41 43 45
86 11 4 518 1137 4 16 26 38 47 55 60 62
114 16 2 760 1744 2 20 35 51 63 73 81 86
151 21 5 1113 2676 5 21 46 67 86 98 109 117
200 22 10 1632 4105 10 25 59 89 116 135 148 159
265 27 10 2391 6298 10 34 75 118 154 184 203 217
351 37 6 3505 9662 6 47 97 157 206 248 278 298
465 43 7 5136 14823 7 57 127 207 278 333 378 408

TableForm[Table[sol = ncompk[n, k, 2, 5] ; If[sol>0, sol, ""], {n, 1, 25}, {k, 1, 12}]]

1
1
1 1
1 2
3 1
4 3
3 6 1
2 10 4
1 12 10 1
12 20 5
10 31 15 1
6 40 35 6
3 44 65 21 1
1 40 101 56 7
31 135 120 28 1
20 155 216 84 8
10 155 336 203 36 1
4 135 456 413 120 9
1 101 546 728 322 45 1
65 580 1128 728 165 10
35 546 1554 1428 486 55 1
15 456 1918 2472 1206 220 11
5 336 2128 3823 2598 705 66 1
1 216 2128 5328 4950 1902 286 12

TableForm[Table[sol = ncompk[n, k, 3, 7] ; If[sol>0, sol, ""], {n, 1, 25}, {k, 1, 6}]]

1
1
1
1 1
1 2
3
4 1
5 3
4 6
3 10 1
2 15 4
1 18 10
19 20 1
18 35 5
15 52 15
10 68 35 1
6 80 70 6
3 85 121 21
1 80 185 56
68 255 126
52 320 246
35 365 426
20 381 666

TableForm[Table[sol = npart[n, a, 10] ; If[sol>0, sol, ""], {n, 1, 25}, {a, 10, 2, -1}]]

1
1 1
1 1 2
1 1 1 2
1 1 1 2 4
1 1 1 1 2 4
1 1 1 1 2 3 7
1 1 1 1 1 2 4 8
1 1 1 1 1 2 3 5 12
1 2 5 13
1 2 4 8 20
1 2 4 9 22
1 2 3 6 11 31
1 2 4 6 14 36
1 2 3 4 8 17 48
1 2 2 4 8 19 55
1 2 2 3 5 11 25 73
1 1 1 2 5 11 28 83
1 1 1 1 3 7 15 34 107
1 3 7 15 40 123
1 4 8 19 47 154
2 4 9 20 54 177
1 3 6 11 26 66 220
1 3 5 12 27 74 251

TableForm[Table[sol = npartk[n, k, 2, 10] ; If[sol>0, sol, ""], {n, 1, 25}, {k, 1, 12}]]

1
1
1 1
1 1
1 2 1
1 2 1
1 3 2 1
1 3 3 1
1 4 4 2 1
4 5 3 1
5 7 5 2 1
4 8 6 3 1
4 10 9 5 2 1
3 11 11 7 3 1
3 12 15 10 5 2 1
2 12 17 13 7 3 1
2 13 21 18 11 5 2 1
1 12 23 22 14 7 3 1
1 12 27 28 20 11 5 2 1
11 28 33 25 15 7 3 1
10 31 40 33 21 11 5 2 1
8 31 45 40 27 15 7 3 1
7 33 52 51 36 22 11 5 2 1
5 31 57 59 45 28 15 7 3 1

TableForm[Table[sol = npartk[n, k, 3, 10] ; If[sol>0, sol, ""], {n, 1, 25}, {k, 1, 12}]]

1
1
1
1 1
1 1
1 2
1 2 1
1 3 1
3 2
4 3 1
4 4 1
4 5 2
3 7 3 1
3 8 5 1
2 9 6 2
2 10 9 3 1
1 10 11 5 1
1 10 14 7 2
10 16 10 3 1
9 19 13 5 1
8 20 17 7 2
7 23 21 11 3 1
5 23 26 14 5 1

TableForm[Table[sol = npartk[n, k, 4, 10] ; If[sol>0, sol, ""], {n, 1, 25}, {k, 1, 12}]]

1
1
1
1
1 1
1 1
1 2
2
3 1
3 1
4 2
3 3
3 4 1
2 5 1
2 7 2
1 7 3
1 8 5 1
8 6 1
8 9 2
7 10 3
7 13 5 1
5 14 7 1

TableForm[Table[sol = npartk[n, k, 5, 10] ; If[sol>0, sol, ""], {n, 1, 25}, {k, 1, 12}]]

1
1
1
1
1
1 1
1
2
2
3
3 1
3 1
2 2
2 3
1 4
1 5 1
6 1
6 2
6 3
6 5
5 6 1

TableForm[Table[sol = npartk[n, k, 6, 10] ; If[sol>0, sol, ""], {n, 1, 25}, {k, 1, 12}]]

1
1
1
1
1
1
1
2
2
3
2
2 1
1 1
1 2
3
4
4
5 1
4 1

TableForm[Table[sol = npartk[n, k, 7, 10] ; If[sol>0, sol, ""], {n, 1, 25}, {k, 1, 12}]]

1
1
1
1
1
1
2
2
2
1
1
1
1
2
3
3

TableForm[Table[sol = npartk[n, k, 8, 10] ; If[sol>0, sol, ""], {n, 1, 25}, {k, 1, 12}]]

1
1
1
1
1
2
1
1
1
1

TableForm[Table[sol = npartk[n, k, 9, 10] ; If[sol>0, sol, ""], {n, 1, 25}, {k, 1, 12}]]

1
1
1
1
1

TableForm[Table[sol = npartk[n, k, 10, 10] ; If[sol>0, sol, ""], {n, 1, 25}, {k, 1, 12}]]

1
1

Created by Mathematica  (June 10, 2009) Valid XHTML 1.1!