login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Triangle read by rows: T(k,n) (k >= 0, n = 0, ..., k) = number of tilings of a k X n rectangle using 2 X 2 and 1 X 1 tiles and dominoes.
16

%I #24 May 16 2022 09:33:29

%S 1,1,1,1,2,8,1,3,26,163,1,5,90,1125,15623,1,8,306,7546,210690,5684228,

%T 1,13,1046,51055,2865581,154869092,8459468955,1,21,3570,344525,

%U 38879777,4207660108,460706560545,50280716999785,1,34,12190,2326760,527889422,114411435032,25111681648122,5492577770367562,1202536689448371122

%N Triangle read by rows: T(k,n) (k >= 0, n = 0, ..., k) = number of tilings of a k X n rectangle using 2 X 2 and 1 X 1 tiles and dominoes.

%C For the tiling algorithm, see A351322.

%C The table is read by rows. Reading the sequence {T(k,n)}, n=0,1,2,..., use T(n,k) instead of T(k,n) for n>k.

%H Gerhard Kirchner, <a href="/A352589/a352589_1.txt">Maxima code</a>

%e Triangle T(k,n) begins

%e k\n_0__1____2______3________4__________5____________6

%e 0: 1

%e 1: 1 1

%e 2: 1 2 8

%e 3: 1 3 26 163

%e 4: 1 5 90 1125 15623

%e 5: 1 8 306 7546 210690 5684228

%e 6: 1 13 1046 51055 2865581 154869092 8459468955

%p b:= proc(n, l) option remember; local k, t;

%p if n=0 or l=[] then 1

%p elif min(l[])>0 then t:=min(l[]); b(n-t, map(h->h-t, l))

%p else for k while l[k]>0 do od; b(n, subsop(k=1, l))+

%p `if`(n>1, b(n, subsop(k=2, l)), 0)+ `if`(k<nops(l)

%p and l[k+1]=0, b(n, subsop(k=1, k+1=1, l))+

%p `if`(n>1, b(n, subsop(k=2, k+1=2, l)), 0), 0)

%p fi

%p end:

%p T:= (n, k)-> b(max(n, k), [0$min(n, k)]):

%p seq(seq(T(n, k), k=0..n), n=0..10); # _Alois P. Heinz_, May 06 2022

%t b[n_, l_List] := b[n, l] = Module[{k, t}, Which[

%t n == 0 || l == {}, 1,

%t Min[l] > 0, t = Min[l]; b[n - t, l - t],

%t True, For[k = 1, l[[k]] > 0, k++]; b[n, ReplacePart[l, k -> 1]] +

%t If[n > 1, b[n, ReplacePart[l, k -> 2]], 0] + If[k < Length[l] &&

%t l[[k + 1]] == 0, b[n, ReplacePart[l, {k -> 1, k + 1 -> 1}]] +

%t If[n > 1, b[n, ReplacePart[l, {k -> 2, k+1 -> 2}]], 0], 0]]];

%t T[n_, k_] := b[Max[n, k], Array[0&, Min[n, k]]];

%t Table[Table[T[n, k], {k, 0, n}], {n, 0, 10}] // Flatten (* _Jean-François Alcover_, May 16 2022, after _Alois P. Heinz_ *)

%o (Maxima) See Maxima code link.

%Y T(1,n) = A000045(n+1), Fibonacci numbers.

%Y T(2,n) = A052543(n).

%Y T(3,n) = A226351(n).

%Y T(4,n) = A352590(n).

%Y T(5,n) = A352591(n).

%Y T(n,n) gives A353777.

%K nonn,tabl

%O 0,5

%A _Gerhard Kirchner_, Mar 22 2022