login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A062112
a(0)=0; a(1)=1; a(n) = a(n-1) + (3 + (-1)^n)*a(n-2)/2.
4
0, 1, 1, 2, 4, 6, 14, 20, 48, 68, 164, 232, 560, 792, 1912, 2704, 6528, 9232, 22288, 31520, 76096, 107616, 259808, 367424, 887040, 1254464, 3028544, 4283008, 10340096, 14623104, 35303296, 49926400, 120532992, 170459392, 411525376
OFFSET
0,4
FORMULA
a(2*n) = A007070(n+1).
a(2*n+1) = A006012(n).
G.f.: x*(1+x-2*x^2)/(1-4*x^2+2*x^4).
a(n) = 4*a(n-2) - 2*a(n-4), a(0)=0, a(1)=1, a(2)=1, a(3)=2. - Harvey P. Dale, May 24 2013
EXAMPLE
a(4) = a(3) + 2*a(2) = 2 + 2 = 4.
MATHEMATICA
RecurrenceTable[{a[0]==0, a[1]==1, a[n]==a[n-1]+(3+(-1)^n) (a[n-2])/2}, a, {n, 40}] (* or *) LinearRecurrence[{0, 4, 0, -2}, {0, 1, 1, 2}, 40] (* Harvey P. Dale, May 24 2013 *)
PROG
(PARI) { for (n=0, 200, if (n>1, a=a1 + (3 + (-1)^n)*a2/2; a2=a1; a1=a, if (n==0, a=a2=0, a=a1=1)); write("b062112.txt", n, " ", a) ) } \\ Harry J. Smith, Aug 01 2009
(Magma) m:=30; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(x*(1+x-2*x^2)/(1-4*x^2+2*x^4))); // G. C. Greubel, Oct 16 2018
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Olivier Gérard, Jun 05 2001
STATUS
approved