OFFSET
0,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (-1,4,4).
FORMULA
a(2*n) = 5-2^(2*n), a(2*n+1) = 10-3*a(2n).
a(n)+a(n+1) = A135520(n).
a(n) = 1/6*2^n*a(0) + 1/4*2^n*a(1) - 1/2*a(0)*(-2)^n - 1/3*(-1)^n*a(2) - 1/4*a(1)*(-2)^n + 4/3*(-1)^n*a(0) + 1/4*(-2)^n*a(2) + 1/12*2^n*a(2). - Alexander R. Povolotsky, Mar 31 2008
From R. J. Mathar, Jun 15 2009: (Start)
G.f.: (4+2*x-17*x^2)/((1+2*x)*(1-2*x)*(1+x)).
a(n) = 2^(n-2)+5*(-1)^n*(1-2^(n-2)). (End)
a(n) = (5*(-2)^n-40*(-1)^n+2^n)/8 for n > 0. - Harvey P. Dale, Jun 10 2011
MATHEMATICA
LinearRecurrence[{-1, 4, 4}, {4, -2, 1}, 50] (* Harvey P. Dale, Jun 10 2011 *)
(* Alternative: *)
Table[(5(-2)^n- 40(-1)^n+2^n)/8, {n, 50}] (* Harvey P. Dale, Jun 10 2011 *)
PROG
(Magma) [2^(n-2)+5*(-1)^n*(1-2^(n-2)): n in [0..40]]; // Vincenzo Librandi, Aug 09 2011
(PARI) a(n)=if(n, (2^n-5*(-2)^n)/4+5*(-1)^n, 4) \\ Charles R Greathouse IV, Jun 03 2026
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Paul Curtz, Mar 17 2008
EXTENSIONS
Edited by N. J. A. Sloane, Apr 18 2008
More terms from Harvey P. Dale, Jun 10 2011
Name edited by Michel Marcus, Jun 03 2026
STATUS
approved
