OFFSET
0,3
LINKS
Muniru A Asiru, Table of n, a(n) for n = 0..5000
Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
FORMULA
G.f.: (1 + x + x^3)/(1 - x^2)^2.
From Paul Barry, Aug 29 2004: (Start)
a(n) = (3*n + 2)/4 + (2 - n)*(-1)^n/4.
a(n) = 2*a(n-2) - a(n-4).
Binomial transform is A098156. (End)
From Gary W. Adamson, May 08 2010: (Start)
Let M = an infinite lower triangular matrix with (1, 1, 0, 1, 0, 0, 0, ...) in every column; for columns > 0, shifted down twice from the previous column.
Then A029579 = M * [1, 2, 3, 0, 0, 0, ...]. (End)
From Paul Curtz, Sep 21 2018: (Start)
a(-n) = -A174239(n).
Terms of A026741(n+1) swapped in pairs. (End)
MAPLE
seq(coeff(series((1+x+x^3)/(1-x^2)^2, x, n+1), x, n), n = 0 .. 80); # Muniru A Asiru, Sep 21 2018
MATHEMATICA
With[{nn = 50}, Riffle[Range[nn], Range[1, 2 nn + 1, 2]]] (* or *) LinearRecurrence[{0, 2, 0, -1}, {1, 1, 2, 3}, 120] (* Harvey P. Dale, Apr 22 2018 *)
PROG
(Haskell)
import Data.List (transpose)
a029579 n = if m == 0 then n' + 1 else n where (n', m) = divMod n 2
a029579_list = concat $ transpose [[1 ..], [1, 3 ..]]
-- Reinhard Zumkeller, Apr 06 2015
(PARI) a(n)=(3*n+2+(2-n)*(-1)^n)/4 \\ Charles R Greathouse IV, Sep 02 2015
(GAP) a:=[1, 1, 2, 3];; for n in [5..80] do a[n]:=2*a[n-2]-a[n-4]; od; a; # Muniru A Asiru, Sep 21 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Title simplified by Sean A. Irvine, Feb 29 2020
STATUS
approved