OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..200
Manfred Scheucher, C Code
EXAMPLE
The partitions of 6 in Mathematica order are 6, 51, 42, 411, 33, 321, 3111, 222, 2211, 21111, 111111. The position of 321 is a(3) = 6.
MAPLE
g:= (n, i)-> `if`(n=0, 1, g(n-i+1, i-1)+ b(n-i, 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=n+1..m)+
g(m-n, n))(n*(n+1)/2):
seq(a(n), n=0..25); # Alois P. Heinz, Jun 03 2015
MATHEMATICA
r[n_] := Table[n - k, {k, 0, n - 1}]; Flatten[Table[Position[IntegerPartitions[n (n + 1)/2], r[n]], {n, 0, 2}]]
g[n_, i_] := If[n==0, 1, g[n-i+1, i-1] + b[n-i, 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, n+1, m}] + g[m-n, n]][n(n+1)/2]; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Oct 28 2015, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Mar 04 2014
EXTENSIONS
a(13)-a(17) from Manfred Scheucher, Jun 01 2015
a(18)-a(25) from Alois P. Heinz, Jun 02 2015
STATUS
approved