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.

A120909 Triangle read by rows: T(n,k) is the number of ternary words of length n having k runs (i.e., subwords of maximal length) of identical letters (1 <= k <= n).

Original entry on oeis.org

3, 3, 6, 3, 12, 12, 3, 18, 36, 24, 3, 24, 72, 96, 48, 3, 30, 120, 240, 240, 96, 3, 36, 180, 480, 720, 576, 192, 3, 42, 252, 840, 1680, 2016, 1344, 384, 3, 48, 336, 1344, 3360, 5376, 5376, 3072, 768, 3, 54, 432, 2016, 6048, 12096, 16128, 13824, 6912, 1536, 3, 60
Offset: 1

Views

Author

Emeric Deutsch, Jul 15 2006

Keywords

Comments

Row sums are the powers of 3 (A000244).

Examples

			T(3,2)=12 because we have 001,002,011,022,100,110,112,122,200,211,220 and 221.
Triangle starts:
  3;
  3,  6;
  3, 12, 12;
  3, 18, 36, 24;
  3, 24, 72, 96, 48;
		

Crossrefs

Programs

  • Maple
    T:=(n,k)->3*2^(k-1)*binomial(n-1,k-1): for n from 1 to 11 do seq(T(n,k),k=1..n) od; # yields sequence in triangular form
  • Mathematica
    nn=15;f[list_]:=Select[list,#>0&];a=y x/(1-x) +1;b=a^2/(1-(a-1)^2 );Drop[Map[f,CoefficientList[Series[b a/(1-(a-1)(b-1)),{x,0,nn}],{x,y}]],1]//Grid  (* Geoffrey Critzer, Nov 20 2012 *)

Formula

T(n,k) = 3*2^(k-1)*binomial(n-1,k-1).
G(t,z) = 3*t*z/(1-z-2*t*z).
T(n,k) = 3*A013609(n-1,k-1).
T(n,k) = A120910(n,n-k).
Sum_{k>=1} k*T(n,k) = 3*A081038(n-1).