OFFSET
0,2
FORMULA
a(n) = Sum_{j=1..n} (1-(-1)^j-(-2)^j)*binomial(n,j)*a(n-j) for n > 0.
a(n) = 2^n + Sum_{j=1..n} (3^j-1)*binomial(n,j)*a(n-j).
a(n) = 1 + Sum_{j=1..n} (2^j-(-1)^j)*binomial(n,j)*a(n-j).
E.g.f.: exp(2*x)/(1 + exp(x) - exp(3*x)). - Vaclav Kotesovec, Jun 01 2024
MATHEMATICA
nmax = 20; CoefficientList[Series[E^(2*x)/(1 + E^x - E^(3*x)), {x, 0, nmax}], x]*Range[0, nmax]! (* Vaclav Kotesovec, Jun 01 2024 *)
PROG
(SageMath)
def a(n):
if n==0:
return 1
else:
return sum([(1-(-1)^j-(-2)^j)*binomial(n, j)*a(n-j) for j in [1, .., n]])
list(a(n) for n in [0, .., 20])
CROSSREFS
KEYWORD
nonn
AUTHOR
Prabha Sivaramannair, May 11 2024
STATUS
approved