cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

A218827 Number of indecomposable (by shuffling) alternating n-anagrams.

Original entry on oeis.org

1, 1, 3, 16, 129, 1438, 20955, 384226, 8623101, 231978454, 7359117591, 271673905642, 11543742745689, 559348370431630, 30659822500574739, 1887796293833267746, 129757032076160998677, 9900820197631733600518, 834421415151529202479023, 77318409826165250051727514
Offset: 1

Views

Author

Michel Marcus, Nov 07 2012

Keywords

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.

Crossrefs

Cf. A000366, A218826. First column of A239895.

Programs

  • 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 *)
  • 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), ", "););}
Showing 1-1 of 1 results.