OFFSET
0,2
COMMENTS
Alternating row sums of A105810.
Riordan triangle ((1 + x - x^2)/(1 + x)^2, x/(1 + x)).
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (-3,-2).
FORMULA
O.g.f.: (1+x-x^2)/((1+x)*(1+2*x)).
a(n) = (3/2)*b(n) + (5/2)*b(n-1), n>=1, a(0) = 1, with b(n) = A225883(n+1).
a(n) = (-1)^n*(1 + 2^(n-1)), n>=1, a(0) = 1.
E.g.f.: 2*exp(-x)*(cosh(x/2))^2 - 1. - G. C. Greubel, May 30 2025
MATHEMATICA
Table[((-1)^n*(2^n+2) - Boole[n==0])/2, {n, 0, 50}] (* G. C. Greubel, May 30 2025 *)
PROG
(PARI) Vec((1 + x - x^2)/((1 + x)*(1 + 2*x)) + O (x^40)) \\ Michel Marcus, Oct 11 2014
(Magma)
A248155:= func< n | n eq 0 select 1 else (-1)^n*(2^(n-1) + 1) >;
[A248155(n): n in [0..50]]; // G. C. Greubel, May 30 2025
(Python)
def A248155(n): return ((-1)**n*(2 + 2**n) - int(n==0))//2
print([A248155(n) for n in range(51)]) # G. C. Greubel, May 30 2025
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Wolfdieter Lang, Oct 04 2014
STATUS
approved
