A198410 a(n) = ((3^(n-1) + 1)^3 -1)/3^n.
7, 37, 271, 2269, 19927, 177877, 1596511, 14355469, 129159847, 1162320517, 10460530351, 94143710269, 847290203767, 7625602267957, 68630391713791, 617673439330669, 5559060695695687, 50031545486420197, 450283907053258831, 4052555156505760669, 36472996387631139607
Offset: 2
Examples
a(2) = ((3 + 1)^3 - 1)/3^2 = 63/9 = 7.
Links
- Vincenzo Librandi, Table of n, a(n) for n = 2..200
- Index entries for linear recurrences with constant coefficients, signature (13,-39,27).
Crossrefs
Cf. A060073.
Programs
-
Magma
I:=[7,37,271]; [n le 3 select I[n] else 13*Self(n-1)-39*Self(n-2)+27*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Mar 25 2014
-
Maple
A198410 := proc(n) (3^(n-1)+1)^3 ; (%-1)/3^n ; end proc: seq(A198410(n), n=2..20) ; # R. J. Mathar, Oct 25 2011
-
Mathematica
Table[((3^(n - 1) + 1)^3 - 1)/3^n, {n, 2, 20}] (* Wesley Ivan Hurt, Mar 24 2014 *) CoefficientList[Series[(7 - 54 x + 63 x^2)/((1 - x) (3 x - 1) (9 x - 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 25 2014 *) LinearRecurrence[{13,-39,27},{7,37,271},30] (* Harvey P. Dale, Mar 04 2015 *)
-
PARI
a(n)=9^n/27+3^n/3+1 \\ Charles R Greathouse IV, Jun 11 2015
Formula
G.f.: -x^2*(7-54*x+63*x^2) / ( (x-1)*(3*x-1)*(9*x-1) ). - R. J. Mathar, Oct 25 2011
a(n) = 13*a(n-1)-39*a(n-2)+27*a(n-3) for n>2. - Vincenzo Librandi, Mar 25 2014
Comments