A025579 a(1)=1, a(2)=2, a(n) = 4*3^(n-3) for n >= 3.
1, 2, 4, 12, 36, 108, 324, 972, 2916, 8748, 26244, 78732, 236196, 708588, 2125764, 6377292, 19131876, 57395628, 172186884, 516560652, 1549681956, 4649045868, 13947137604, 41841412812, 125524238436, 376572715308, 1129718145924
Offset: 1
Links
- Colin Barker, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (3).
Programs
-
GAP
Concatenation([1,2], List([3..30], n-> 4*3^(n-3) )); # G. C. Greubel, Dec 26 2019
-
Magma
[1,2] cat [4*3^(n-3): n in [3..30]]; // G. C. Greubel, Dec 26 2019
-
Maple
seq( `if`(n<3, n, 4*3^(n-3)), n=1..30); # G. C. Greubel, Dec 26 2019
-
Mathematica
Join[{1,2},4*3^Range[0,30]] (* or *) Join[{1,2},NestList[3#&,4,30]] (* Harvey P. Dale, Jun 27 2011 *)
-
PARI
a(n)=max(n,4*3^(n-3)) \\ Charles R Greathouse IV, Jun 28 2011
-
PARI
Vec(x*(1+x)*(1-2*x)/(1-3*x) + O(x^30)) \\ Colin Barker, Oct 29 2019
-
Sage
[1,2]+[4*3^(n-3) for n in (3..30)] # G. C. Greubel, Dec 26 2019
Formula
a(n) = A003946(n-2), n>2. - R. J. Mathar, May 28 2008
From Colin Barker, Oct 29 2019: (Start)
G.f.: x*(1 + x)*(1 - 2*x) / (1 - 3*x).
a(n) = 3*a(n-1) for n>3. (End)
Extensions
Definition corrected by R. J. Mathar, May 28 2008
Comments