OFFSET
0,3
COMMENTS
Compare to the identity:
Sum_{n>=0} x^n * Product_{k=1..n} (k + x) / (1 + k*x + x^2) = (1+x^2)/(1-x).
Compare to the g.f. of A187741:
Sum_{n>=0} x^n * (1 + n*x)^n / (1 + x + n*x^2)^n = 1/2 + (1+2*x)*Sum_{n>=0} (n+1)!*x^(2*n)/2.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..597
FORMULA
G.f.: 1/2 + Sum_{n>=1} n!/2 * x^(n-1) * (1+x)^n / Product_{k=1..n} (1 + k*x). - Paul D. Hanna, Oct 27 2013
a(n) = A229046(n+1)/2 for n>0.
a(n) = (1/2)*Sum_{k=0..floor((n+1)/2)} Sum_{i=0..k} (-1)^i * C(k,i) * (k-i+1)^(n-k+1) for n>1. (See Paul Barry's formula in A105795). - Paul D. Hanna, Jul 13 2014
EXAMPLE
G.f.: A(x) = 1 + x + 2*x^2 + 5*x^3 + 14*x^4 + 44*x^5 + 152*x^6 + 572*x^7 +...
where
A(x) = 1 + x*(1+x)/(1+x+x^2) + x^2*(1+2*x)*(2+2*x)/((1+x+2*x^2)*(1+2*x+2*x^2)) + x^3*(1+3*x)*(2+3*x)*(3+3*x)/((1+x+3*x^2)*(1+2*x+3*x^2)*(1+3*x+3*x^2)) + x^4*(1+4*x)*(2+4*x)*(3+4*x)*(4+4*x)/((1+x+4*x^2)*(1+2*x+4*x^2)*(1+3*x+4*x^2)*(1+4*x+4*x^2)) +...
Also, we have the identity (cf. A229046):
A(x) = 1/2 + (1/2)*(1+x)/(1+x) + (2!/2)*x*(1+x)^2/((1+x)*(1+2*x)) + (3!/2)*x^2*(1+x)^3/((1+x)*(1+2*x)*(1+3*x)) + (4!/2)*x^3*(1+x)^4/((1+x)*(1+2*x)*(1+3*x)*(1+4*x)) + (5!/2)*x^4*(1+x)^5/((1+x)*(1+2*x)*(1+3*x)*(1+4*x)*(1+5*x)) +...
MAPLE
b:= proc(n, k) option remember; `if`(n<1, 1, `if`(k>
ceil(n/2), 0, add((k-j)*b(n-1-j, k-j), j=0..1)))
end:
a:= n-> ceil(add(b(n+2, k), k=1..1+ceil(n/2))/2):
seq(a(n), n=0..25); # Alois P. Heinz, Jan 26 2018
MATHEMATICA
b[n_, k_] := b[n, k] = If[n < 1, 1, If[k > Ceiling[n/2], 0, Sum[(k - j) b[n - 1 - j, k - j], {j, 0, 1}]]];
a[n_] := Ceiling[Sum[b[n + 2, k], {k, 1, 1 + Ceiling[n/2]}]/2];
Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Jun 05 2018, after Alois P. Heinz *)
PROG
(PARI) {a(n)=polcoeff( sum(m=0, n, x^m*prod(k=1, m, (k+m*x)/(1+k*x+m*x^2 +x*O(x^n))) ), n)}
for(n=0, 30, print1(a(n), ", "))
(PARI) {a(n)=polcoeff( 1/2 + sum(m=1, n+1, m!/2*x^(m-1)*(1+x)^m/prod(k=1, m, 1+k*x +x*O(x^n))), n)}
for(n=0, 30, print1(a(n), ", "))
(PARI) {a(n)=if(n<0, 0, if(n<1, 1, (1/2)*sum(k=0, floor((n+1)/2), sum(i=0, k, (-1)^i*binomial(k, i)*(k-i+1)^(n-k+1)))))} \\ Paul D. Hanna, Jul 13 2014
for(n=0, 30, print1(a(n), ", "))
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Jan 09 2013
STATUS
approved