A052919 a(n) = 1 + 2*3^(n-1) with a(0)=2.
2, 3, 7, 19, 55, 163, 487, 1459, 4375, 13123, 39367, 118099, 354295, 1062883, 3188647, 9565939, 28697815, 86093443, 258280327, 774840979, 2324522935, 6973568803, 20920706407, 62762119219, 188286357655, 564859072963
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Gennady Eremin, Arithmetization of well-formed parenthesis strings. Motzkin Numbers of the Second Kind, arXiv:2012.12675 [math.CO], 2020.
- INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 902
- Index entries for linear recurrences with constant coefficients, signature (4,-3).
Programs
-
GAP
Concatenation([2], List([1..30], n-> 1 + 2*3^(n-1) )); # G. C. Greubel, Oct 16 2019
-
Magma
I:=[2, 3, 7]; [n le 3 select I[n] else 4*Self(n-1)-3*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Jun 22 2012
-
Maple
spec := [S,{S=Union(Sequence(Prod(Sequence(Z),Union(Z,Z))),Sequence(Z))}, unlabeled]: seq(combstruct[count](spec, size=n), n=0..20); seq(`if`(n=0, 2, 1 + 2*3^(n-1)), n=0..30); # G. C. Greubel, Oct 16 2019
-
Mathematica
Join[{2},Table[2*(3^n+1)-1,{n,0,30}]] (* Vladimir Joseph Stephan Orlovsky, Feb 14 2011*) CoefficientList[Series[(2-5*x+x^2)/((1-x)*(1-3*x)),{x,0,40}],x] (* Vincenzo Librandi, Jun 22 2012 *) LinearRecurrence[{4,-3},{2,3,7},30] (* Harvey P. Dale, Dec 12 2017 *)
-
PARI
vector(31, n, if(n==1, 2, 1+ 2*3^(n-2))) \\ G. C. Greubel, Oct 16 2019
-
Sage
[2]+[1+2*3^(n-1) for n in (1..30)] # G. C. Greubel, Oct 16 2019
Formula
a(n) = 1 + 2*3^(n-1) for n > 0 with a(0) = 2.
G.f.: (2 - 5*x + x^2)/((1-x)*(1-3*x)).
a(n) = 4*a(n-1) - 3*a(n-2), with a(0)=2, a(1)=3, a(2)=7.
a(0) = 2 and a(n) = A100702(n) for n >= 1. - Omar E. Pol, Mar 02 2012
Extensions
More terms from James Sellers, Jun 05 2000
Comments