A122117 a(n) = 3*a(n-1) + 4*a(n-2), with a(0)=1, a(1)=2.
1, 2, 10, 38, 154, 614, 2458, 9830, 39322, 157286, 629146, 2516582, 10066330, 40265318, 161061274, 644245094, 2576980378, 10307921510, 41231686042, 164926744166, 659706976666, 2638827906662, 10555311626650, 42221246506598
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (3,4).
Programs
-
GAP
a:=[1,2];; for n in [3..30] do a[n]:=3*a[n-1]+4*a[n-2]; od; a; # G. C. Greubel, May 18 2019
-
Magma
I:=[1, 2]; [n le 2 select I[n] else 3*Self(n-1)+4*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Jul 06 2012
-
Mathematica
CoefficientList[Series[(1-x)/(1-3*x-4*x^2),{x,0,30}],x] (* Vincenzo Librandi, Jul 06 2012 *)
-
PARI
Vec((1-x)/(1-3*x-4*x^2)+O(x^30)) \\ Charles R Greathouse IV, Jan 11 2012
-
Python
def A122117(n): return ((4<<(m:=n<<1))|2)//5-((1<
Chai Wah Wu, Apr 22 2025 -
Sage
from sage.combinat.sloane_functions import recur_gen2b; it = recur_gen2b(1,2,3,4, lambda n: 0); [next(it) for i in range(24)] # Zerinvary Lajos, Jul 03 2008
-
Sage
((1-x)/(1-3*x-4*x^2)).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, May 18 2019
Formula
a(n) = 2*A108981(n-1) for n > 0, with a(0) = 1.
a(2*n) = 4*a(2*n-1) + 2, a(2*n+1) = 4*a(2*n) - 2.
a(n) = Sum_{k=0..n} 2^(n-k)*A055380(n,k).
G.f.: (1-x)/(1-3*x-4*x^2).
Lim_{n->infinity} a(n+1)/a(n) = 4.
a(n) = Sum_{k=0..n} A122016(n,k)*2^k. - Philippe Deléham, Nov 05 2008
a(n) = A100088(2*n). - Chai Wah Wu, Apr 22 2025
Extensions
Corrected by T. D. Noe, Nov 07 2006
Comments