OFFSET
1,3
FORMULA
EXAMPLE
a(5)=5 because 5 = 1+4 = 1+1+3 = 1+2+2 = 2+3. (1+1+1+2 and 1+1+1+1+1 have too many ones.)
MATHEMATICA
<< DiscreteMath`Combinatorica`; f[n_] := Block[{c = 0, k = 1, p = Partitions[n], l = PartitionsP[n]}, While[k < l, c1 = Count[p[[k]], 1]; If[ Plus @@ Take[ p[[k]], Length[ p[[k]]] - c1] >= c1, c++ ]; k++ ]; c]; Table[ f[n], {n, 1, 25}]
PROG
(PARI) mybinary(n, m)=local(u); u=binary(n); concat(vector(m-length(u), i, 0), u); { for (n=2, 16, y=vector(2^(n-1)); for (j=0, 2^(n-1)-1, x=concat(mybinary(j, n-1), [1]); y[j+1]=vector(n); c=0; for (k=1, n, if (x[k]==1, y[j+1][k]=c+1; c=0, c++)); y[j+1]=vecsort(y[j+1])); y=vecsort(y, QQ=QQ, 2);
for (i=1, 2^(n-1)-1, z=1; if (type(y[i])=="t_VEC", while (y[i]==y[i+z], y[i+z]=0; z++))); sc=0; for(i=1, 2^(n-1), if (type(y[i])=="t_VEC", os=0; rs=0; for (q=1, n, if (y[i][q]==1, os++, rs+=y[i][q])); if (os<=rs, sc++))); print1(sc", ") )}
CROSSREFS
KEYWORD
nonn
AUTHOR
Jon Perry, Jun 15 2003
EXTENSIONS
More terms from Vladeta Jovovic and Don Reble, Jun 15 2003
STATUS
approved