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.

A120908 Sum of the lengths of the drops in all ternary words of length n on {0,1,2}. The drops of a ternary word on {0,1,2} are the subwords 10,20 and 21, their lengths being the differences 1, 2 and 1, respectively.

Original entry on oeis.org

0, 4, 24, 108, 432, 1620, 5832, 20412, 69984, 236196, 787320, 2598156, 8503056, 27634932, 89282088, 286978140, 918330048, 2927177028, 9298091736, 29443957164, 92980917360, 292889889684, 920511081864, 2887057484028
Offset: 1

Views

Author

Emeric Deutsch, Jul 15 2006

Keywords

Comments

a(n) = 4*A027471(n).
a(n) = Sum_{k>=0} k*A120907(n,k).

Examples

			a(2)=4 because the ternary words 00,01,02,11,12 and 22 have no drops, each of the words 10 and 21 has one drop of length 1 and the word 20 has one drop of length 2.
		

Crossrefs

Programs

  • Magma
    [4*(n-1)*3^(n-2): n in [1..30]]; // Vincenzo Librandi, Jun 09 2011
    
  • Maple
    seq(4*(n-1)*3^(n-2),n=1..27);
  • Mathematica
    Table[4*(n-1)*3^(n-2), {n, 30}] (* Wesley Ivan Hurt, Jan 28 2014 *)
    LinearRecurrence[{6,-9},{0,4},30] (* Harvey P. Dale, Jul 14 2023 *)
  • PARI
    a(n) = 4*(n-1)*3^(n-2); \\ Altug Alkan, May 16 2018

Formula

a(n) = 4*(n-1)*3^(n-2).
G.f.: 4*z^2/(1-3*z)^2.

A120907 Triangle read by rows: T(n,k) is the number of ternary words of length n on {0,1,2} having sum of the lengths of the drops equal to k (n>=0, k>=0). The drops of a ternary word on {0,1,2} are the subwords 10,20 and 21, their lengths being the differences 1, 2 and 1, respectively.

Original entry on oeis.org

1, 3, 6, 2, 1, 10, 10, 7, 15, 30, 31, 4, 1, 21, 70, 105, 36, 11, 28, 140, 294, 184, 76, 6, 1, 36, 252, 714, 696, 396, 78, 15, 45, 420, 1554, 2160, 1666, 566, 141, 8, 1, 55, 660, 3102, 5808, 5918, 2990, 995, 136, 19, 66, 990, 5775, 13992, 18348, 12746, 5615, 1280, 226
Offset: 0

Views

Author

Emeric Deutsch, Jul 15 2006

Keywords

Comments

Row n has 2*floor(n/2)+1 terms (i.e. each of the rows 2n and 2n+1 has 2n+1 terms). Row sums are the powers of 3 (A000244). T(n,0)=A000217(n+1) (the triangular numbers). Sum(k*T(n,k),k>=0)=4(n-1)3^(n-2)=A120908(n)=4*A027471(n).

Examples

			T(4,3)=4 because we have 1020,2010,2021 and 2120.
Triangle starts:
1;
3;
6,2,1;
10,10,7;
15,30,31,4,1;
21,70,105,36,11;
		

Crossrefs

Programs

  • Maple
    G:=1/(1-z+t*z)/(1-2*z+z^2-t*z-t*z^2): Gser:=simplify(series(G,z=0,15)): P[0]:=1: for n from 1 to 12 do P[n]:=sort(coeff(Gser,z^n)) od: for n from 0 to 12 do seq(coeff(P[n],t,j),j=0..2*floor(n/2)) od; # yields sequence in triangular form

Formula

G.f.=G(t,z)=1/[(1-z+tz)(1-2z+z^2-tz-tz^2)].
Showing 1-2 of 2 results.