%I #22 Feb 25 2020 12:27:03
%S 1,1,4,25,217,2470,35647,637129,13843948,360022957,11054457253,
%T 396003680518,16377463914091,774714094061221,41572230979229284,
%U 2512149910125036865,169831839578092130017,12769241823369505582150,1062122471116082751430087,97264621940872013476357969
%N Number of indecomposable (by concatenation) alternating n-anagrams.
%C Alternating anagrams enumeration is related to A000366 by a(n) = A000366(n+1).
%C For all n, a(n) are periodically congruent to 1, 1 and 4 modulo 6.
%H Andrew Howroyd, <a href="/A218826/b218826.txt">Table of n, a(n) for n = 1..200</a>
%H G. Kreweras and J. Barraud, <a href="http://dx.doi.org/10.1006/eujc.1997.0161">Anagrammes alternés</a>, European Journal of Combinatorics,Volume 18, Issue 8, November 1997, Pages 887-891.
%H G. Kreweras and D. Dumont, <a href="http://dx.doi.org/10.1016/S0012-365X(99)00238-1">Sur les anagrammes alternés</a>, Discrete Mathematics, Volume 211, Issues 1-3, 28 January 2000, Pages 103-110.
%F G.f.: (1-Q(0))/x, where Q(k)= 1 - 1/2*(k+1)*(k+2)*x/(1 - 1/2*(k+1)*(k+2)*x/Q(k+1)); (continued fraction). - _Sergei N. Gladkovskii_, May 03 2013
%F G.f.: 1/Q(0), where Q(k) = 1 - (k+1)*(k+2)/2*x/(1 - (k+2)*(k+3)/2*x/Q(k+1) ; (continued fraction). - _Sergei N. Gladkovskii_, Nov 17 2013
%F a(n) = A000366(n + 1) - Sum_{k=2..n} A239894(n, k). - _Andrew Howroyd_, Feb 25 2020
%o (PARI) a000366(n)= {return((-1/2)^(n-2)*sum(k=0, n, binomial(n, k)*(1-2^(n+k+1))*bernfrac(n+k+1)));}
%o bi(n,k) = {if (matb[n,k] == 0, if (n==k, v=1, if (k==1, v = b(n),v = sum(i=1, n-k+1, b(i)*bi(n-i,k-1)););); matb[n,k] = v;); return (matb[n,k]);}
%o b(n) = {if (n==1, return(a000366(n+1)), return(a000366(n+1) - sum(i=2, n, bi(n,i))));}
%o allb(m) = {matb = matrix(m,m); for (i=1, m, print1(b(i), ", "););}
%Y Cf. A000366, A218827. First column of A239894.
%K nonn
%O 1,3
%A _Michel Marcus_, Nov 07 2012