OFFSET
0,1
COMMENTS
General form: a(n)=2^n-a(n-1). - Vladimir Joseph Stephan Orlovsky, Dec 11 2008
For n>=1, a(n) is a(n) is the number of generalized compositions of n+3 when there are i^2-2*i-1 different types of i, (i=1,2,...). - Milan Janjic, Sep 24 2010
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,2).
FORMULA
a(n) = (2^(n+1)-8*(-1)^n)/3, n>0.
a(n) = a(n-1) + 2*a(n-2), n>2.
G.f.: 2+4*x*(1-x)/((1+x)*(1-2*x)).
MATHEMATICA
g0[n_] = 2 - Sum[(-1)^(i + 1)/Sqrt[2]^(2*i), {i, 0, n}] f[x_] = ZTransform[g0[n], n, x] g[n_] = InverseZTransform[f[1/x], x, n] a0 = Table[Abs[g[n]], {n, 1, 25}]
k=0; lst={k}; Do[k=2^n-k; AppendTo[lst, k], {n, 3, 5!}]; lst (* Vladimir Joseph Stephan Orlovsky, Dec 11 2008 *)
Table[If[n==0, 2, (2^(n+1)-8*(-1)^n)/3], {n, 0, 30}] (* G. C. Greubel, Dec 30 2017 *)
PROG
(PARI) for(n=0, 30, print1(if(n==0, 2, (2^(n+1)-8*(-1)^n)/3), ", ")) \\ G. C. Greubel, Dec 30 2017
(Magma) [2] cat [(2^(n+1)-8*(-1)^n)/3: n in [1..30]]; // G. C. Greubel, Dec 30 2017
CROSSREFS
KEYWORD
nonn,easy,less
AUTHOR
Roger L. Bagula, Mar 06 2006
EXTENSIONS
Edited by the Associate Editors of the OEIS, Aug 21 2009
STATUS
approved