OFFSET
1,2
LINKS
David Wilson, Currency puzzle, SeqFan list, Sept. 25, 2015.
Index entries for linear recurrences with constant coefficients, signature (0,2).
FORMULA
a(n) = 2^ceiling(n/2-1) for n>4.
G.f.: x*(1 - x)*(1 + 3*x + 3*x^2 + 2*x^3 + 2*x^4)/(1 - 2*x^2). [Bruno Berselli, Sep 28 2015]
MATHEMATICA
LinearRecurrence[{0, 2}, {1, 2, 2, 3, 4, 4}, 60] (* Harvey P. Dale, Jul 10 2023 *)
PROG
(PARI) a(n)=2^((n-1)\2)+if(n<5, !bittest(n, 0))
(Magma) [n le 4 select Floor(n/2+1) else 2^Ceiling(n/2-1): n in [1..45]]; // Vincenzo Librandi, Sep 28 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
M. F. Hasler, Sep 27 2015
STATUS
approved