A071954 a(n) = 4*a(n-1) - a(n-2) - 4, with a(0) = 2, a(1) = 4.
2, 4, 10, 32, 114, 420, 1562, 5824, 21730, 81092, 302634, 1129440, 4215122, 15731044, 58709050, 219105152, 817711554, 3051741060, 11389252682, 42505269664, 158631825970, 592022034212, 2209456310874, 8245803209280, 30773756526242, 114849222895684
Offset: 0
Examples
G.f. = 2 + 4*x + 10*x^2 + 32*x^3 + 114*x^4 + 420*x^5 + 1562*x^6 + ...
References
- M. E. Larsen, "Four Cubes" in Puzzler's Tribute, Ed. D. Wolfe & T. Rodgers, pp. 69-70, A. K. Peters, MA, 2002
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000 (terms 0..100 from Reinhard Zumkeller)
- Index entries for linear recurrences with constant coefficients, signature (5,-5,1).
Programs
-
GAP
a:=[2,4,10];; for n in [4..30] do a[n]:=5*a[n-1]-5*a[n-2]+a[n-3]; od; a; # G. C. Greubel, Feb 25 2019
-
Haskell
a071954 n = a071954_list !! n a071954_list = 2 : 4 : zipWith (-) (map ((4 *) . pred) (tail a071954_list)) a071954_list -- Reinhard Zumkeller, Aug 11 2011
-
Magma
I:=[2,4,10]; [n le 3 select I[n] else 5*Self(n-1) -5*Self(n-2) + Self(n-3): n in [1..30]]; // G. C. Greubel, Feb 25 2019
-
Mathematica
a[n_]:= a[n] = 4*a[n-1] -a[n-2] -4; a[0]=2; a[1]=4; Table[a[n], {n,0,30}] LinearRecurrence[{5,-5,1},{2,4,10},30] (* Harvey P. Dale, May 05 2011 *)
-
PARI
Vec((2-6*x)/(1-5*x+5*x^2-x^3)+O(x^30)) \\ Charles R Greathouse IV, Feb 09 2012
-
PARI
{a(n) = my(w=quadgen(12)); simplify( 2 + ((2+w)^n - (2-w)^n) / w)}; /* Michael Somos, Nov 03 2016 */
-
Sage
(2*(1-3*x)/((1-x)*(1-4*x+x^2))).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Feb 25 2019
Formula
a(n) = 5*a(n-1) - 5*a(n-2) + a(n-3) for n > 2, with a(0) = 2, a(1) = 4, a(2) = 10.
G.f.: 2*(1 - 3*x)/((1-x)*(1 -4*x +x^2)). - Harvey P. Dale, May 05 2011
a(n) = (2 + (-(2 - sqrt(3))^n + (2 + sqrt(3))^n)/sqrt(3)). - Colin Barker, Nov 03 2016
A263942(n) = -a(-1-n) for all n in Z. - Michael Somos, Nov 03 2016
E.g.f.: (2/3)*(3*exp(x) + sqrt(3)*exp(2*x)*sinh(sqrt(3)*x)). - Franck Maminirina Ramaharo, Nov 14 2018
From G. C. Greubel, Feb 25 2019: (Start)
a(n) = 2*A072110(n).
a(n) = 2*(1 - (-i)^(n+1)*F(n, 4*i)), where i=sqrt(-1) and F(n,x) is the Fibonacci polynomial. (End)
Extensions
Edited by Robert G. Wilson v, Jun 27 2002
Comments