OFFSET
1,3
COMMENTS
LINKS
G. Kreweras and J. Barraud, Anagrammes alternés, European Journal of Combinatorics,Volume 18, Issue 8, November 1997, Pages 887-891.
G. Kreweras and D. Dumont, Sur les anagrammes alternés, Discrete Mathematics, Volume 211, Issues 1-3, 28 January 2000, Pages 103-110.
MATHEMATICA
m = 20(*terms*); matc = Array[0&, {m, m}];
a366[n_] := (-2^(-1))^(n - 2)*Sum[Binomial[n, k]*(1 - 2^(n + k + 1))* BernoulliB[n + k + 1], {k, 0, n}];
ci[n_, k_] := ci[n, k] = Module[{v}, If[matc[[n, k]] == 0, If[n == k, v = 1, If[k == 1, v = c[n], v = Sum[Binomial[n - 1, i - 1]*c[i]*ci[n - i, k - 1], {i, 1, n - k + 1}]]]; matc[[n, k]] = v]; Return[matc[[n, k]]]];
a[n_] := a366[n + 1] - If[n == 1, 0, Sum[ci[n, i], {i, 2, n}]];
Array[a, m] (* Jean-François Alcover, Aug 03 2019, from PARI *)
PROG
(PARI) a000366(n)= {return((-1/2)^(n-2)*sum(k=0, n, binomial(n, k)*(1-2^(n+k+1))*bernfrac(n+k+1))); }
ci(n, k) = {if (matc[n, k] == 0, if (n==k, v = 1, if (k==1, v = c(n), v = sum(i=1, n-k+1, binomial(n-1, i-1)*c(i)*ci(n-i, k-1)); ); ); matc[n, k] = v; ); return(matc[n, k]); }
c(n) = {if (n==1, return(a000366(n+1)), return(a000366(n+1) - sum(i=2, n, ci(n, i)))); }
allc(m) = {matc = matrix(m, m); for (i=1, m, print1(c(i), ", "); ); }
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Nov 07 2012
STATUS
approved