login
A218827
Number of indecomposable (by shuffling) alternating n-anagrams.
2
1, 1, 3, 16, 129, 1438, 20955, 384226, 8623101, 231978454, 7359117591, 271673905642, 11543742745689, 559348370431630, 30659822500574739, 1887796293833267746, 129757032076160998677, 9900820197631733600518, 834421415151529202479023, 77318409826165250051727514
OFFSET
1,3
COMMENTS
Alternating anagrams enumeration is related to A000366 by a(n) = A000366(n+1).
For n>2, a(n) are alternatively congruent to 3 and -2 modulo 18.
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
Cf. A000366, A218826. First column of A239895.
Sequence in context: A362661 A368791 A135752 * A120021 A223897 A131490
KEYWORD
nonn
AUTHOR
Michel Marcus, Nov 07 2012
STATUS
approved