%I #9 Feb 06 2019 00:35:33
%S 1,1,3,1,12,3,1,39,15,9,1,120,54,72,9,1,363,174,378,81,27,1,1092,537,
%T 1656,459,324,27,1,3279,1629,6579,2115,2349,351,81,1,9840,4908,24624,
%U 8694,13392,2700,1296,81,1,29523,14748,88596,33318,66258,16092
%N Triangle read by rows where the n-th row is the first row of M^n, with M the (n+1)-by-(n+1) matrix with (1,3,1,3,1,3,...) on its main diagonal and (3,1,3,1,3,1,...) on its superdiagonal.
%C Diagonal terms are switched to generate A124573. The row sum of row n is 4^n.
%H Nathaniel Johnston, <a href="/A124572/b124572.txt">Table of n, a(n) for n = 0..5000</a>
%e Row 3 = [1, 39, 15, 9] since when n = 3 we have M^3 = [[1, 39, 15, 9], [0, 27, 13, 21], [0, 0, 1, 39], [0, 0, 0, 27]]. The first few rows of the triangle are:
%e 1;
%e 1, 3;
%e 1, 12, 3;
%e 1, 39, 15, 9;
%e 1, 120, 54, 72, 9;
%e 1, 363, 174, 378, 81, 27;
%e ...
%p with (LinearAlgebra): for n from 0 to 10 do M := Matrix (n+1, (i, j)->`if`(i=j and i mod 2 = 1, 1, `if`(i=j, 3, `if`(i=j-1 and i mod 2 = 1, 3, `if`(i=j-1, 1, 0))))): X := M^n: for m from 0 to n do printf("%d, ", X[1, m+1]): od: od: # _Nathaniel Johnston_, Apr 28 2011
%Y Cf. A124573, A124730, A124731, A029858 (column 2).
%K nonn,easy,tabl
%O 0,3
%A _Gary W. Adamson_ & _Roger L. Bagula_, Nov 04 2006