|
|
A100477
|
|
a(n) = 3*a(n-1) + 2*a(n-2) + a(n-3) if n>=3, otherwise a(n) = n.
|
|
3
|
|
|
0, 1, 2, 8, 29, 105, 381, 1382, 5013, 18184, 65960, 239261, 867887, 3148143, 11419464, 41422565, 150254766, 545028892, 1977018773, 7171368869, 26013173045, 94359275646, 342275541897, 1241558350028, 4503585409524
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
Weighted sum of the three previous terms.
a(n+1) is the number of ways to tile a strip of length n with 3 colors of squares, 2 colors of dominos, and 1 color of tromino, with the restriction that if the first tile is a square, then it can only use two colors. - Greg Dresden and Bora Bursali, Aug 17 2023
|
|
LINKS
|
|
|
FORMULA
|
O.g.f.: x*(1-x)/(1-3*x-2*x^2-x^3).
a(0)=0, a(1)=1, a(2)=2, a(n)=3*a(n-1)+2*a(n-2)+a(n-3). - Harvey P. Dale, Jun 19 2015
|
|
MATHEMATICA
|
RecurrenceTable[{a[n]== 3a[n-1] +2a[n-2] +a[n-3], a[0]==0, a[1]==1, a[2]==2}, a, {n, 0, 26}] (* or *)
CoefficientList[ Series[(x^2-x)/(x^3+2x^2+3x-1), {x, 0, 26}], x] (* Robert G. Wilson v, May 19 2015 *)
LinearRecurrence[{3, 2, 1}, {0, 1, 2}, 40] (* Harvey P. Dale, Jun 19 2015 *)
|
|
PROG
|
(Perl) #!/usr/local/bin/perl -w $d=0; $c=1; $b=2; print "$d, $c, $b, "; $a=0; for (;; ){ $a=3*$b+2*$c+$d; $d=$c; $c=$b; $b=$a; print "$a, "; last if ($a >2**61); } __END__
(Magma) [n le 3 select n-1 else 3*Self(n-1)+2*Self(n-2)+Self(n-3): n in [1..30]]; // Vincenzo Librandi, May 20 2015
(SageMath)
@CachedFunction
if (n<3): return n
else: return 3*a(n-1)+2*a(n-2)+a(n-3)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
gamo (gamo(AT)telecable.es), Nov 22 2004
|
|
STATUS
|
approved
|
|
|
|