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”).

A062113
a(0)=1; a(1)=2; a(n) = a(n-1) + a(n-2)*(3 - (-1)^n)/2.
2
1, 2, 3, 7, 10, 24, 34, 82, 116, 280, 396, 956, 1352, 3264, 4616, 11144, 15760, 38048, 53808, 129904, 183712, 443520, 627232, 1514272, 2141504, 5170048, 7311552, 17651648, 24963200, 60266496, 85229696, 205762688, 290992384, 702517760
OFFSET
0,2
COMMENTS
A bistable recurrence.
FORMULA
a(n) = a(n-1) + a(n-2) * A000034(n). - Reinhard Zumkeller, Jan 21 2012
From Colin Barker, Apr 20 2012: (Start)
a(n) = 4*a(n-2) - 2*a(n-4).
G.f.: (1+2*x-x^2-x^3)/(1-4*x^2+2*x^4). (End)
MATHEMATICA
LinearRecurrence[{0, 4, 0, -2}, {1, 2, 3, 7}, 40] (* G. C. Greubel, Oct 16 2018 *)
PROG
(PARI) { for (n=0, 200, if (n>1, a=a1 + a2*(3 - (-1)^n)/2; a2=a1; a1=a, if (n==0, a=a2=1, a=a1=2)); write("b062113.txt", n, " ", a) ) } \\ Harry J. Smith, Aug 01 2009
(PARI) x='x+O('x^40); Vec((1+2*x-x^2-x^3)/(1-4*x^2+2*x^4)) \\ G. C. Greubel, Oct 16 2018
(Haskell)
a062113 n = a062113_list !! n
a062113_list = 1 : 2 : zipWith (+)
(tail a062113_list) (zipWith (*) a000034_list a062113_list)
-- Reinhard Zumkeller, Jan 21 2012
(Magma) I:=[1, 2, 3, 7]; [n le 4 select I[n] else 4*Self(n-2) - 2*Self(n-4): n in [1..40]]; // G. C. Greubel, Oct 16 2018
CROSSREFS
Sequence in context: A079380 A263402 A047082 * A346799 A130968 A007748
KEYWORD
easy,nonn
AUTHOR
Olivier Gérard, Jun 05 2001
STATUS
approved