OFFSET
0,4
COMMENTS
The binomial transform of (0 followed by A077917).
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,3,-6).
FORMULA
a(n+1) - a(n) = A167784(n).
a(n) = 2*a(n-1) + 3*a(n-2) - 6*a(n-3).
G.f.: x*(1-x)/((1-2*x)*(1-3*x^2)).
a(n) - 2*a(n-1) = (-1)^(n+1)*A083658(n+1).
From G. C. Greubel, Sep 10 2023: (Start)
a(n) = (1/2)*(2^(n+1) - (1+(-1)^n)*3^(n/2) - (1-(-1)^n)*3^((n-1)/2)).
E.g.f.: exp(2*x) - cosh(sqrt(3)*x) - (1/sqrt(3))*sinh(sqrt(3)*x). (End)
MATHEMATICA
LinearRecurrence[{2, 3, -6}, {0, 1, 1}, 50] (* G. C. Greubel, Jul 01 2016 *)
PROG
(Magma) I:=[0, 1, 1]; [n le 3 select I[n] else 2*Self(n-1) +3*Self(n-2) -6*Self(n-3): n in [1..40]]; // G. C. Greubel, Sep 10 2023
(SageMath)
def A167936(n): return 2^n - ((n+1)%2)*3^(n//2) - (n%2)*3^((n-1)//2)
[A167936(n) for n in range(41)] # G. C. Greubel, Sep 10 2023
(Python)
def A167936(n): return (1<<n)-3**(n>>1) # Chai Wah Wu, Nov 14 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Nov 15 2009
EXTENSIONS
Edited and extended by R. J. Mathar, Feb 27 2010
STATUS
approved