A282379 Number of representations of n as a sum of products of pairs of positive integers: n = Sum_{k=1..m} i_k*j_k with m >= 0, i_k <= j_k, j_k > j_{k+1} and all factors distinct with the exception that i_k = j_k is allowed.
1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5, 6, 5, 9, 9, 8, 11, 15, 13, 17, 17, 19, 24, 29, 23, 33, 37, 39, 40, 53, 48, 62, 63, 71, 77, 94, 81, 110, 116, 122, 123, 156, 152, 185, 180, 200, 213, 259, 236, 287, 298, 325, 333, 404, 386, 450, 457, 506, 531, 615, 579, 679, 721
Offset: 0
Keywords
Examples
a(4) = 2: 1*4 = 2*2. a(5) = 2: 1*5 = 2*2+1*1. a(6) = 2: 1*6 = 2*3. a(7) = 3: 1*7 = 2*3+1*1 = 1*3+2*2. a(8) = 3: 1*8 = 2*4 = 1*4+2*2. a(9) = 4: 1*9 = 1*5+2*2 = 2*4+1*1 = 3*3. a(10) = 5: 1*10 = 1*6+2*2 = 2*5 = 1*4+2*3 = 3*3+1*1. a(11) = 6: 1*11 = 1*7+2*2 = 2*5+1*1 = 1*5+2*3 = 2*4+1*3 = 3*3+1*2. a(12) = 5: 1*12 = 1*8+2*2 = 2*6 = 1*6+2*3 = 3*4.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
Crossrefs
Programs
-
Maple
h:= proc(n) option remember; n*(n+1)*(2*n+1)/6 end: g:= (n, i, s)-> `if`(n=0, 1, `if`(n>h(i), 0, b(n, i, select(x-> x<=i, s)))): b:= proc(n, i, s) option remember; g(n, i-1, s)+ `if`(i in s, 0, add(`if`(j in s, 0, g(n-i*j, min(n-i*j, i-1), s union {j})), j=1..min(i, n/i))) end: a:= n-> g(n$2, {}): seq(a(n), n=0..100);
-
Mathematica
h[n_] := h[n] = n(n+1)(2n+1)/6; g[n_, i_, s_ ] := If[n == 0, 1, If[n > h[i], 0, b[n, i, Select[s, # <= i&]]]]; b[n_, i_, s_] := b[n, i, s] = g[n, i - 1, s] + If[MemberQ[s, i], 0, Sum[If[MemberQ[s, j], 0, g[n - i*j, Min[n - i*j, i - 1], s ~Union~ {j}]], {j, 1, Min[i, n/i]}]]; a[n_] := g[n, n, {}]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Aug 01 2021, after Alois P. Heinz *)