OFFSET
0,2
COMMENTS
A bistable recurrence.
LINKS
Harry J. Smith, Table of n, a(n) for n = 0..200
Index entries for linear recurrences with constant coefficients, signature (0,4,0,-2).
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
KEYWORD
easy,nonn
AUTHOR
Olivier Gérard, Jun 05 2001
STATUS
approved