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-2 of 2 results.

A183134 Square array A(n,k) by antidiagonals. A(n,k) is the number of length 2n k-ary words (n,k>=0), either empty or beginning with the first character of the alphabet, that can be built by repeatedly inserting doublets into the initially empty word.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 3, 1, 0, 1, 1, 5, 10, 1, 0, 1, 1, 7, 29, 35, 1, 0, 1, 1, 9, 58, 181, 126, 1, 0, 1, 1, 11, 97, 523, 1181, 462, 1, 0, 1, 1, 13, 146, 1145, 4966, 7941, 1716, 1, 0, 1, 1, 15, 205, 2131, 14289, 48838, 54573, 6435, 1, 0
Offset: 0

Views

Author

Alois P. Heinz, Dec 26 2010

Keywords

Comments

Column k > 2 is asymptotic to 2^(2*n) * (k-1)^(n+1) / ((k-2)^2 * sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Sep 07 2014

Examples

			A(3,2) = 10, because 10 words of length 6 beginning with the first character of the 2-letter alphabet {a, b} can be built by repeatedly inserting doublets (words with two equal letters) into the initially empty word: aaaaaa, aaaabb, aaabba, aabaab, aabbaa, aabbbb, abaaba, abbaaa, abbabb, abbbba.
Square array A(n,k) begins:
  1,  1,   1,    1,    1,     1,  ...
  0,  1,   1,    1,    1,     1,  ...
  0,  1,   3,    5,    7,     9,  ...
  0,  1,  10,   29,   58,    97,  ...
  0,  1,  35,  181,  523,  1145,  ...
  0,  1, 126, 1181, 4966, 14289,  ...
		

Crossrefs

Columns 0-10 give: A000007, A000012, A001700(n-1) for n>0, A194723, A194724, A194725, A194726, A194727, A194728, A194729, A194730.
Main diagonal gives A248828.
Coefficients of row polynomials for k>0 in k, (k+1) are given by A050166, A157491.

Programs

  • Maple
    A:= proc(n, k)
          local j;
          if n=0  then 1
        elif k<=1 then k
                  else add(binomial(2*n,j)*(n-j)*(k-1)^j, j=0..n-1)/n
          fi
        end:
    seq(seq(A(n, d-n), n=0..d), d=0..10);
  • Mathematica
    a[n_, k_] := If[ n == 0, 1 , If[ k <= 1, k, Sum [Binomial[2*n, j]*(n-j)*(k-1)^j, {j, 0, n-1}] / n ] ]; Table[Table[a[n, d-n], {n, 0, d}], {d, 0, 10}] // Flatten (* Jean-François Alcover, Dec 09 2013, translated from Maple *)

Formula

A(n,k) = 1 if n=0, A(n,k) = k if n>0 and k<=1, and A(n,k) = 1/n * Sum_{j=0..n-1} C(2*n,j)*(n-j)*(k-1)^j else.
A(n,k) = A183135(n,k) if n=0 or k<2, A(n,k) = A183135(n,k)/k else.
G.f. of column k: 1/(1-k*x) if k<2, (1-1/k) * (1 + 2 / (k-2 + k * sqrt (1-(4*k-4)*x))) else.

A183135 Square array A(n,k) by antidiagonals. A(n,k) is the number of length 2n k-ary words (n,k>=0) that can be built by repeatedly inserting doublets into the initially empty word.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 3, 6, 1, 0, 1, 4, 15, 20, 1, 0, 1, 5, 28, 87, 70, 1, 0, 1, 6, 45, 232, 543, 252, 1, 0, 1, 7, 66, 485, 2092, 3543, 924, 1, 0, 1, 8, 91, 876, 5725, 19864, 23823, 3432, 1, 0, 1, 9, 120, 1435, 12786, 71445, 195352, 163719, 12870, 1, 0
Offset: 0

Views

Author

Alois P. Heinz, Dec 26 2010

Keywords

Comments

A(n,k) is also the number of rooted closed walks of length 2n on the infinite rooted k-ary tree. - Danny Rorabaugh, Oct 31 2017
A(n,2k) is the number of unreduced words of length 2n that reduce to the empty word in the free group with k generators. - Danny Rorabaugh, Nov 09 2017

Examples

			A(2,2) = 6, because 6 words of length 4 can be built over 2-letter alphabet {a, b} by repeatedly inserting doublets (words with two equal letters) into the initially empty word: aaaa, aabb, abba, baab, bbaa, bbbb.
Square array A(n,k) begins:
  1,  1,   1,    1,     1,     1,  ...
  0,  1,   2,    3,     4,     5,  ...
  0,  1,   6,   15,    28,    45,  ...
  0,  1,  20,   87,   232,   485,  ...
  0,  1,  70,  543,  2092,  5725,  ...
  0,  1, 252, 3543, 19864, 71445,  ...
		

Crossrefs

Rows n=0-3 give: A000012, A001477, A000384, A027849(k-1) for k>0.
Main diagonal gives A294491.
Coefficients of row polynomials in k, (k-1) are given by A157491, A039599.

Programs

  • Maple
    A:= proc(n, k) local j;
          if n=0 then 1
                 else k/n *add(binomial(2*n,j) *(n-j) *(k-1)^j, j=0..n-1)
          fi
        end:
    seq(seq(A(n, d-n), n=0..d), d=0..10);
  • Mathematica
    A[, 1] = 1; A[n, k_] := If[n == 0, 1, k/n*Sum[Binomial[2*n, j]*(n - j)*(k - 1)^j, {j, 0, n - 1}]]; Table[Table[A[n, d - n], {n, 0, d}], {d, 0, 10}] // Flatten (* Jean-François Alcover, Dec 27 2013, translated from Maple *)

Formula

A(n,k) = k/n * Sum_{j=0..n-1} C(2*n,j)*(n-j)*(k-1)^j if n>0, A(0,k) = 1.
A(n,k) = A183134(n,k) if n=0 or k<2, A(n,k) = A183134(n,k)*k otherwise.
G.f. of column k: 1/(1-k*x) if k<2, 2*(k-1)/(k-2+k*sqrt(1-(4*k-4)*x)) otherwise.
Showing 1-2 of 2 results.