%I #19 Nov 14 2022 04:53:21
%S 1,91,1410,33543,670734,14383251,299383290,6310987263,132315428934,
%T 2780561320011,58374353168370,1226018323723383,25744972644839934,
%U 540657134887786371,11353685448630220650,238428423877048161903,5006987636316607975734
%N Expansion of g.f. x*(1 +82*x +366*x^2 -189*x^3)/((1+3*x)*(1+9*x)*(1-21*x)).
%C Former name: a(n) = leftmost term of M^n * [1,0,0,0,0,0] where M is the 6 X 6 matrix [1,2,3,4,5,6; 2,3,1,5,6,4; 3,1,2,6,4,5; 4,6,5,1,3,2; 5,4,6,2,1,3; 6,5,4,3,2,1].
%C M is a multiplication table for the symmetric group of degree 3 (S_3).
%H Nathaniel Johnston, <a href="/A120756/b120756.txt">Table of n, a(n) for n = 1..200</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (9,225,567).
%F G.f.: x*(1 +82*x +366*x^2 -189*x^3)/((1+3*x)*(1+9*x)*(1-21*x)). - _Colin Barker_, Dec 13 2012
%F From _G. C. Greubel_, Nov 14 2022: (Start)
%F a(n) = (9*(21)^n + 9*(-9)^n + 24*(-3)^n + 18*[n=1] - 42*[n=0])/54.
%F E.g.f.: (1/54)*(-42 + 18*x + 24*exp(-3*x) + 9*exp(-9*x) + 9*exp(21*x)). (End)
%t LinearRecurrence[{9,225,567},{1,91,1410,33543},20] (* _Harvey P. Dale_, Apr 11 2018 *)
%t M= {{1,2,3,4,5,6}, {2,3,1,5,6,4}, {3,1,2,6,4,5}, {4,6,5,1,3,2}, {5,4,6,2,1,3}, {6, 5,4,3,2,1}};
%t A120756[n_]:= A120756[n]= MatrixPower[M, n][[1,1]];
%t Table[A120756[n], {n,30}] (* _G. C. Greubel_, Nov 14 2022 *)
%o (Magma) I:=[91,1410,33543]; [1] cat [n le 3 select I[n] else 9*Self(n-1) + 225*Self(n-2) +567*Self(n-3): n in [1..31]]; // _G. C. Greubel_, Nov 14 2022
%o (SageMath)
%o def A120756(n): return (9*(21)^n +9*(-9)^n +24*(-3)^n +18*int(n==1) -42*int(n==0))/54
%o [A120756(n) for n in range(1,30)] # _G. C. Greubel_, Nov 14 2022
%K nonn,easy
%O 1,2
%A _Gary W. Adamson_ and _Roger L. Bagula_, Jul 01 2006
%E Edited by _N. J. A. Sloane_, May 06 2010
%E Name changed by _G. C. Greubel_, Nov 14 2022
|