OFFSET
0,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..5000
Index entries for linear recurrences with constant coefficients, signature (0,3,0,-2).
FORMULA
a(0)=1; for n > 0, a(n) = a(n-1)*(1 + n mod 2) + 2*((n+1) mod 2).
G.f.: (2*x^3 + x^2 + 2*x + 1)/(2*x^4 - 3*x^2 + 1).
3*2^ceiling(n/2) + (-1)^n - 3. - Ralf Stephan, Dec 04 2004
a(2*n) = A033484(n).
a(n-1) + a(n) = A061776(n) for n > 0.
E.g.f.: -2*cosh(x) + 3*cosh(sqrt(2)*x) - 4*sinh(x) + 3*sqrt(2)*sinh(sqrt(2)*x). - Franck Maminirina Ramaharo, Nov 08 2018
MATHEMATICA
LinearRecurrence[{0, 3, 0, -2}, {1, 2, 4, 8}, 50] (* Harvey P. Dale, May 03 2016 *)
PROG
(PARI) print1(a=1, ", "); for(n=1, 20, print1(a=2*a, ", ", a=a+2, ", "))
(Magma) [3*2^Ceiling(n/2) + (-1)^n - 3: n in [0..50]]; // Vincenzo Librandi, Aug 17 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Nov 12 2004
EXTENSIONS
Edited and extended by Klaus Brockhaus, Nov 13 2004
STATUS
approved