Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #26 Sep 08 2022 08:45:13
%S 6,31,144,621,2538,9963,37908,140697,511758,1830519,6456024,22497669,
%T 77590386,265189059,899198172,3027619377,10130328342,33705582543,
%U 111577100832,367662044061,1206427402746,3943553157531,12845313733284
%N a(n) = A081038(n) + A077616(n).
%C Performing the same operation but using the multiplier [1 0 0] yields [3^n 2*A027471(n+1) A077616(n)]. Example: M^4 * [1 0 0] = [81 216 324] where 324 = A077616(4) and 216/2 = 108 = A027471(5).
%H G. C. Greubel, <a href="/A094951/b094951.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (9,-27,27).
%F a(n) = A081038(n) + A077616(n).
%F Let M = the 3 X 3 matrix [3 0 0 / 2 3 0 / 1 2 3]; then M^n * [1 1 1] = [3^n A081038(n) a(n)], where a(n) - A081038(n) = A077616(n).
%F From _Colin Barker_, Nov 09 2012: (Start)
%F a(n) = 3^(n-2)*(9 + 7*n + 2*n^2).
%F a(n) = 9*a(n-1) - 27*a(n-2) + 27*a(n-3).
%F G.f.: x*(6 - 23*x + 27*x^2)/(1-3*x)^3. (End)
%F E.g.f.: -1 + (1 + 3*x + 2*x^2)*exp(3*x). - _G. C. Greubel_, Jun 06 2019
%e a(3) = 144 = 81 + 63 = A081038(3) + A077616(3).
%e a(4) = 621 = 297 + 324 = A081038(4) + A077616(4).
%e a(4) = 621 since M^4 * [1 1 1] = [81 297 621] = [3^4 A081038(4), a(4)].
%t a[n_] := (MatrixPower[{{3, 0, 0}, {2, 3, 0}, {1, 2, 3}}, n].{{1}, {1}, {1}})[[3, 1]]; Table[ a[n], {n, 23}] (* _Robert G. Wilson v_, Jun 05 2004 *)
%t Table[3^(n-2)*(9+7*n+2*n^2), {n,1,30}] (* _G. C. Greubel_, Jun 06 2019 *)
%o (PARI) vector(30, n, 3^(n-2)*(9+7*n+2*n^2)) \\ _G. C. Greubel_, Jun 06 2019
%o (Magma) [3^(n-2)*(9+7*n+2*n^2): n in [1..30]]; // _G. C. Greubel_, Jun 06 2019
%o (Sage) [3^(n-2)*(9+7*n+2*n^2) for n in (1..30)] # _G. C. Greubel_, Jun 06 2019
%o (GAP) List([1..30], n-> 3^(n-2)*(9+7*n+2*n^2)) # _G. C. Greubel_, Jun 06 2019
%Y Cf. A081038, A077616, A027471.
%K nonn,easy
%O 1,1
%A _Gary W. Adamson_, May 26 2004
%E Edited and extended by _Robert G. Wilson v_, Jun 05 2004