OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..14
Manfred Scheucher, C-Code
EXAMPLE
The partitions of 4 in Mathematica order are 4, 31, 22, 211, 111. a(2) = 4 is the position of 211, which as a partition is equivalent to row 2 of Pascal's triangle: 1 2 1 (where the top row is counted as row 0).
MAPLE
p:= (n, k)-> binomial(n, iquo(2*n-k+1, 2)):
g:= (n, k, i)-> `if`(n=0, 1, g(n-p(k, i-1), k, i-1)
+add(b(n-j, j), j=p(k, i-1)+1..min(n, p(k, i)))):
b:= proc(n, i) option remember; `if`(n=0, 1,
`if`(i<1, 0, b(n, i-1)+`if`(i>n, 0, b(n-i, i))))
end:
a:= n-> (m-> add(b(m-j, min(j, m-j)), j=p(n$2)+1..m)
+g(m-p(n$2), n$2))(2^n):
seq(a(n), n=0..10); # Alois P. Heinz, Jun 03 2015
MATHEMATICA
r[n_] := Reverse[Sort[Table[Binomial[n, k], {k, 0, n}]]]; Flatten[Table[Position[IntegerPartitions[2^n], r[n]], {n, 0, 6}]]
(* second program: *)
$RecursionLimit = 2000;
p[n_, k_] := Binomial[n, Quotient[2*n - k + 1, 2]];
g[n_, k_, i_] := If[n == 0, 1, g[n - p[k, i - 1], k, i - 1] + Sum[b[n - j, j], {j, p[k, i - 1] + 1, Min[n, p[k, i]]}]];
b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0, b[n, i - 1] + If[i > n, 0, b[n - i, i]]]];
a[n_] := Function[m, Sum[b[m - j, Min[j, m - j]], {j, p[n, n] + 1, m}] + g[m - p[n, n], n, n]][2^n];
Table[a[n], {n, 0, 10}] (* Jean-François Alcover, Aug 30 2016, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Mar 04 2014
EXTENSIONS
a(7) from Manfred Scheucher, May 29 2015
a(8)-a(12) from Alois P. Heinz, Jun 03 2015
STATUS
approved